question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Yellow line highlighting in jupyter notebook unreadable in default dark themes

See original GitHub issue

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

I’m not positive if this is primarily a bug in vscode or something else, but after updating vscode (as well as upgrading a few packages in pip), the yellow highlighted lines in python error tracebacks in jupyter notebooks have become essentially unreadable in the default dark themes…

Screen Shot 2022-01-13 at 4 33 39 PM

…and better-but-not-great even in the light themes (though I have always used the dark theme before, so I can’t say if the light theme here is better, worse, or same than it was previously) Screen Shot 2022-01-13 at 4 50 25 PM

VS Code Version

Version: 1.63.2 Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3 Date: 2021-12-15T09:37:28.172Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin x64 20.6.0

Jupyter Extension Version

v2021.11.1001550889

Jupyter logs

Jupyter Extension Version: 2021.11.1001550889.
Python Extension Verison: 2021.12.1559732655.
Info 16:43:46: Experimentation service retrieved: [object Object]
User belongs to experiment group 'jupyterTest'
User belongs to experiment group 'jupyterEnhancedDataViewer'
Info 16:43:46: ZMQ install verified.
Info 16:43:46: Pre-warming kernel daemon for [redacted]
Info 16:43:48: Experiment status for python is {"enabled":true,"optInto":[],"optOutFrom":[]}
Info 16:43:49: Creating controller for jupyter-notebook with interpreter ~/.pyenv/shims/python3
Info 16:43:51: Freferred kernel connection found in cache .jvsc74a57bd08d3bee82523df57872750accfd1cec38af9ec179d4291b45fb1cca0911ed8e96./Users/ysaxon/.pyenv/shims/python3./Users/ysaxon/.pyenv/shims/python3.-m#ipykernel_launcher
Info 16:43:51: PreferredConnection: .jvsc74a57bd08d3bee82523df57872750accfd1cec38af9ec179d4291b45fb1cca0911ed8e96./Users/ysaxon/.pyenv/shims/python3./Users/ysaxon/.pyenv/shims/python3.-m#ipykernel_launcher found for NotebookDocument: untitled:Untitled-1.ipynb?jupyter-notebook
Info 16:43:51: TargetController found ID: .jvsc74a57bd08d3bee82523df57872750accfd1cec38af9ec179d4291b45fb1cca0911ed8e96./Users/ysaxon/.pyenv/shims/python3./Users/ysaxon/.pyenv/shims/python3.-m#ipykernel_launcher for document untitled:Untitled-1.ipynb?jupyter-notebook
Info 16:43:51: Setting controller affinity for untitled:Untitled-1.ipynb?jupyter-notebook .jvsc74a57bd08d3bee82523df57872750accfd1cec38af9ec179d4291b45fb1cca0911ed8e96./Users/ysaxon/.pyenv/shims/python3./Users/ysaxon/.pyenv/shims/python3.-m#ipykernel_launcher
Info 16:43:51: Process Execution: > ~/.pyenv/shims/python3 -m pip list
> ~/.pyenv/shims/python3 -m pip list
Info 16:43:51: Process Execution: > ~/.pyenv/shims/python3 -c "import ipykernel"
> ~/.pyenv/shims/python3 -c "import ipykernel"
Info 16:43:52: Registering dummy command feature
Warn 16:43:54: Got env variables but with errors, stdErr:pyenv: activate: command not found
, stdOut: e8b39361-0157-4923-80e1-22d70d46dee6
{"PYENV_ROOT": "/Users/ysaxon/.pyenv", "SHELL": "/bin/zsh", "CLICOLOR": "1", "TMPDIR": "/var/folders/l5/hz74y6ps3x1gktbp6wq4kng80000gn/T/", "PYTHONUNBUFFERED": "1", "ORIGINAL_XDG_CURRENT_DESKTOP": "undefined", "HOMEBREW_AUTO_UPDATE_SECS": "36000", "PYENV_VERSION": "3.9.1", "USER": "ysaxon", "PYTHONIOENCODING": "utf-8", "LS_COLORS": "di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43", "COMMAND_MODE": "unix2003", "VSCODE_VERBOSE_LOGGING": "true", "PYTHONWARNINGS": "ignore", [redacted], "PYENV_DIR": "/", "__CF_USER_TEXT_ENCODING": "0x1F5:0x0:0x0", "VSCODE_PIPE_LOGGING": "true", "VSCODE_LOG_STACK": "false", "ELECTRON_RUN_AS_NODE": "1", "VSCODE_AMD_ENTRYPOINT": "vs/workbench/services/extensions/node/extensionHostProcess", "LSCOLORS": "Gxfxcxdxbxegedabagacad", "PATH":[redacted], "__CFBundleIdentifier": "com.microsoft.VSCode", "PWD": "/", "DOTNET_ROOT": "/usr/local/opt/dotnet/libexec", "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true", "PYENV_HOOK_PATH": "/Users/ysaxon/.pyenv/pyenv.d:/usr/local/Cellar/pyenv/2.2.2/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks", "XPC_FLAGS": "0x0", "VSCODE_LOG_NATIVE": "false", "XPC_SERVICE_NAME": "0", "HOME": "/Users/ysaxon", "SHLVL": "1", "PYENV_SHELL": "zsh", "APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "true", "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}", [redacted], "LOGNAME": "ysaxon", "VSCODE_CODE_CACHE_PATH": "/Users/ysaxon/Library/Application Support/Code/CachedData/899d46d82c4c95423fb7e10e68eba52050e30ba3", "VSCODE_IPC_HOOK": "/Users/ysaxon/Library/Application Support/Code/1.63.2-main.sock", "VSCODE_PID": "49288", [redacted], "DISPLAY": "/private/tmp/com.apple.launchd.KosoosRCV0/org.xquartz:0", "VSCODE_CWD": "/", "LC_CTYPE": "UTF-8"}

Info 16:43:54: Creating daemon process for ~/.pyenv/shims/python3 with env variables count 44
Info 16:43:54: Process Execution: > ~/.pyenv/shims/python3 -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~/.pyenv/shims/python3 -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
Info 16:43:54: Setting setActiveController for untitled:Untitled-1.ipynb?jupyter-notebook
Info 16:43:54: KernelProvider switched kernel to id = .jvsc74a57bd0d56f012628c4bdae5b36dd163bc1bea99a0fa96644464dcc722a7d645b866801./Users/ysaxon/.pyenv/versions/3.9.1/python./Users/ysaxon/.pyenv/versions/3.9.1/python.-m#ipykernel_launcher
Info 16:43:54: Starting Notebook in kernel.ts id = .jvsc74a57bd0d56f012628c4bdae5b36dd163bc1bea99a0fa96644464dcc722a7d645b866801./Users/ysaxon/.pyenv/versions/3.9.1/python./Users/ysaxon/.pyenv/versions/3.9.1/python.-m#ipykernel_launcher
Info 16:43:54: Creating raw notebook for untitled:Untitled-1.ipynb?jupyter-notebook
Info 16:43:54: Getting preferred kernel for untitled:Untitled-1.ipynb?jupyter-notebook
Info 16:43:54: Computing working directory untitled:Untitled-1.ipynb?jupyter-notebook
Info 16:43:54: Starting raw kernel 3.9.1 (Python 3.9.1)
Info 16:43:54: installMissingDependencies ~/.pyenv/versions/3.9.1/bin/python
Info 16:43:54: IPykernel found previously in this enviornment ~/.pyenv/versions/3.9.1/bin/python
Info 16:43:54: Kernel launching with ports 9000,9001,9002,9003,9004. Start port is 9000
Info 16:43:54: Launching kernel daemon for Python 3.9.1 64-bit ('3.9.1': pyenv) # ~/.pyenv/versions/3.9.1/bin/python
Info 16:43:54: No custom variables for Kernel as interpreter is not conda, but is Pyenv
Info 16:44:00: Process Execution: > ~/.pyenv/versions/3.9.1/bin/python -m pip list
> ~/.pyenv/versions/3.9.1/bin/python -m pip list
Info 16:44:00: Creating daemon process for ~/.pyenv/versions/3.9.1/bin/python with env variables count 0
Info 16:44:00: Process Execution: > ~/.pyenv/versions/3.9.1/bin/python -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~/.pyenv/versions/3.9.1/bin/python -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
Info 16:44:01: Starting kernel from scratch
Warn 16:44:08: StdErr from Kernel Process /Users/ysaxon/.pyenv/versions/3.9.1/lib/python3.9/site-packages/traitlets/traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.

Warn 16:44:08: StdErr from Kernel Process   warn(

Warn 16:44:08: StdErr from Kernel Process /Users/ysaxon/.pyenv/versions/3.9.1/lib/python3.9/site-packages/traitlets/traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'e0b76c2c-a262-4384-a16c-6b6db6ef909b' instead of 'b"e0b76c2c-a262-4384-a16c-6b6db6ef909b"'.

Warn 16:44:08: StdErr from Kernel Process   warn(

Warn 16:44:08: Didn't get response for requestKernelInfo after 23ms.
Info 16:44:08: Raw session started and connected
Started kernel 3.9.1 (Python 3.9.1)
Info 16:44:08: Finished connecting 5f25f0b4-34bb-4ecf-8ea8-f716d1d0f2dd
Info 16:44:08: UpdateWorkingDirectoryAndPath in Kernel
Info 16:44:08: Executing (status unknown) silently Code = %config Completer.use_jedi = False
Info 16:44:08: Executing silently Code (completed) = %config Completer.use_jedi = False
Info 16:44:08: Executing (status idle) silently Code = %config InlineBackend.figure_formats = ['png']
Info 16:44:08: Executing silently Code (completed) = %config InlineBackend.figure_formats = ['png']
Info 16:44:08: Executing (status idle) silently Code = import sys\nprint(sys.executable)
Info 16:44:08: Executing silently Code (completed) = import sys\nprint(sys.executable)
Info 16:44:08: Waiting for idle on (kernel): f150c805-0f4e-41c7-b5e7-2ecc37d9ec3e -> idle
Info 16:44:08: Finished waiting for idle on (kernel): f150c805-0f4e-41c7-b5e7-2ecc37d9ec3e -> idle
Info 16:44:08: IPyWidgetScriptSource.initialize
Info 16:44:10: Registering dummy command feature

Coding Language and Runtime Version

Python 3.9.1

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
rchiodocommented, Sep 23, 2022

The root cause of this problem before was IPython adding ascii color tokens to the output. You could check your IPython version, perhaps they’ve added new colors since we addressed this. Your best bet would be to open a new issue though.

1reaction
antonioalegriacommented, Sep 23, 2022

I still seem to have this problem and I’m using all the latest versions as of September 23rd – do I need to change some configuration?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change error highlight color Jupyter Notebook
When a cell throws an error in a Jupyter notebook the line the threw it is highlighted in yellow. I want to know...
Read more >
Change color of error highlighting (hard to read) in jupyter ...
I changed jupyter notebook's theme through jupyterthemes, but some of the error output is difficult to read, as it is white text with...
Read more >
JupyterLab Changelog — JupyterLab 3.6.0b0 documentation
Extract @jupyterlab/shared-models to @jupyter-notebook/ydoc #13398 (@fcollonval) ... Fix illegible white on yellow text of stacktrace in dark theme #13249 ...
Read more >
Modus Themes (Modus Operandi and Modus Vivendi)
Brief: Use bold for code syntax highlighting and related. Symbol: modus-themes-bold-constructs ( boolean type). Possible values: nil (default) ...
Read more >
Modus themes for GNU Emacs
Line highlighting, Choose style of current line (hl-line-mode) ... (modus-themes-load-operandi) ; Light theme ;; OR (modus-themes-load-vivendi) ; Dark theme.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found