microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.28k stars 289 forks source link

Scrolling in notebooks sucks user back to particular output #15405

Open gdebrun2 opened 6 months ago

gdebrun2 commented 6 months ago

While scrolling in a .ipynb in vscode, scrolling often breaks and attempts to suck the user back from the new location to a particular cell output. Anecdotally, the kind of outputs that seem to trigger this behavior are matplotlib plots and python error tracebacks (especially tracebacks). I have found no way to halt this behavior and it is widespread across notebooks. After restarting the session, the issue often appears again. Disabling all extensions except python, Jupyter, and Jupyter renderers does not fix the issue. Sometimes the issue will fix itself in a notebook and work for some period before returning. The problem output does not seem to have any significance. I have seen the issue get caught on different cell outputs in the same notebook. This issue does not occur in Jupyterlab or PyCharm. The rendering issue in #14459 may be related.

Version info:

Problem has persisted through various versions for all of the above and is reproducible with a barebones evironment

Vscode json settings:

{ "python.condaPath": "/Users/gavin/miniconda3/condabin/conda", "python.analysis.inlayHints.functionReturnTypes": false, "python.analysis.inlayHints.pytestParameters": true, "python.analysis.inlayHints.callArgumentNames":"all", "python.analysis.typeCheckingMode": "off", "python.analysis.inlayHints.variableTypes": false, "python.analysis.logLevel": "Trace", "files.autoSave": "afterDelay", "files.autoSaveDelay": 100, "editor.formatOnSave": true, "editor.formatOnPaste": true, "editor.formatOnType": true, "editor.defaultFormatter": "ms-python.black-formatter", "editor.wordWrapColumn": 80, "editor.wordWrap": "wordWrapColumn", "editor.tabSize": 4, "editor.parameterHints.enabled": false, "editor.inlineSuggest.showToolbar": "never", "editor.autoClosingBrackets": "never", "editor.autoClosingQuotes": "never", "black-formatter.showNotifications": "onWarning", "notebook.lineNumbers": "on", "notebook.output.textLineLimit": 150, "notebook.formatOnSave.enabled": true, "notebook.formatOnCellExecution": true, "jupyter.pythonExportMethod": "nbconvert", "jupyter.askForKernelRestart": false, "jupyter.logging.level": "verbose", "quarto.render.renderOnSave": true, "quarto.visualEditor.markdownWrapColumn": 80, "[r]": { "editor.defaultFormatter": "REditorSupport.r", }, "[rmd]": { "editor.defaultFormatter": "REditorSupport.r", }, "r.lsp.diagnostics": false, "r.lsp.debug": false, "r.lsp.enabled": true, "remote.SSH.connectTimeout": 60, "github.copilot.enable": { "quarto": true, "*": true }, "workbench.editorAssociations": { "*.md": "vscode.markdown.preview.editor", "*.csv": "gc-excelviewer-csv-editor" }, "explorer.confirmDelete": false, "git.enableSmartCommit": true, "security.workspace.trust.enabled": false, "workbench.startupEditor": "none", "editor.suggest.showWords": false, "editor.suggest.showConstructors": false, "editor.suggest.showDeprecated": false, "editor.suggest.showEnumMembers": false, "editor.suggest.showEnums": false, "editor.suggest.showEvents": false, "editor.suggest.showInterfaces": false, "editor.suggest.showIssues": false, "editor.suggest.showSnippets": false, "editor.suggest.showUsers": false, "editor.suggest.showUnits": false, "editor.suggest.showTypeParameters": false, "editor.suggest.showStructs": false, "editor.suggest.showReferences": false, "editor.suggest.showOperators": false, "editor.suggest.showModules": false, "editor.suggest.showInlineDetails": false, "editor.inlineSuggest.enabled": true, "editor.suggest.localityBonus": true, "editor.suggest.showKeywords": false, "editor.suggest.showClasses": false, "editor.suggest.showConstants": false, }

Logs Context:

Issue is reoccurring throughout multiple notebooks with fewer outputs and code cells

Jupyter Logs:

Visual Studio Code (1.87.2, undefined, desktop) Jupyter Extension Version: 2024.2.0. Python Extension Version: 2024.2.1. Pylance Extension Version: 2024.3.1. Platform: darwin (arm64). Workspace folder ~/Documents/Courses/PHYS446/ising, Home = /Users/gavin 22:47:04.588 [debug] Get Custom Env Variables, Class name = Rm (started execution), Arg 1: undefined, Arg 2: "RunPythonCode" 22:47:04.588 [info] Start refreshing Kernel Picker (1710906424588) 22:47:04.595 [info] Using Pylance 22:47:04.629 [debug] No controller, hence notebook communications cannot be initialized for editor ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:47:04.629 [info] Start refreshing Interpreter Kernel Picker 22:47:04.677 [debug] Get Custom Env Variables, Class name = Rm, completed in 89ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode" 22:47:04.677 [debug] Jupyter Paths /kernels: 22:47:04.678 [debug] Kernel Spec Root Paths, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/Library/Jupyter/kernels 22:47:04.681 [debug] Search for KernelSpecs in Interpreter /usr/bin/python3 22:47:04.682 [debug] Finding Global Python KernelSpecs 22:47:04.682 [warn] No interpreter with path ~/anaconda3/bin/python found in Python API, will convert Uri path to string as Id ~/anaconda3/bin/python 22:47:04.683 [debug] Search for KernelSpecs in Interpreter ~/miniconda3/envs/analysis/bin/python 22:47:04.684 [debug] Search for KernelSpecs in Interpreter ~/miniconda3/bin/python 22:47:04.686 [debug] Search for KernelSpecs in Interpreter ~/miniconda3/envs/tmp/bin/python 22:47:04.688 [debug] Search for KernelSpecs in Interpreter /opt/homebrew/bin/python3 22:47:04.693 [debug] Full interpreter list is length: 5, /usr/bin/python3::Unknown:/usr/bin/python3, ~/miniconda3/envs/analysis/bin/python:analysis:Conda:~/miniconda3/envs/analysis/bin/python, ~/miniconda3/bin/python:base:Conda:~/miniconda3/bin/python, ~/miniconda3/envs/tmp/bin/python:tmp:Conda:~/miniconda3/envs/tmp/bin/python, /opt/homebrew/bin/python3::Unknown:/opt/homebrew/bin/python3 22:47:04.693 [debug] Getting activated env variables, Class name = yp (started execution), Arg 1: "~/Documents/Courses/PHYS446/ising", Arg 2: "/opt/homebrew/bin/python3", Arg 3: undefined 22:47:04.693 [debug] Get Custom Env Variables, Class name = Rm (started execution), Arg 1: "~/Documents/Courses/PHYS446/ising", Arg 2: "RunPythonCode" 22:47:04.693 [debug] Get Custom Env Variables, Class name = Rm, completed in 0ms, has a truthy return value, Arg 1: "~/Documents/Courses/PHYS446/ising", Arg 2: "RunPythonCode" 22:47:04.869 [debug] Kernels for interpreter /usr/bin/python3 are .jvsc74a57bd031f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6./usr/bin/python3./usr/bin/python3.-m#ipykernel_launcher 22:47:04.870 [debug] Kernels for interpreter ~/miniconda3/bin/python are .jvsc74a57bd01440b1a065c7bcf202ad0fbf242eb952aa001309ea14ed3c0a353997a1b98e23.~/miniconda3/python.~/miniconda3/python.-m#ipykernel_launcher 22:47:04.870 [debug] Kernels for interpreter /opt/homebrew/bin/python3 are .jvsc74a57bd0b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e./opt/homebrew/bin/python3./opt/homebrew/bin/python3.-m#ipykernel_launcher 22:47:04.897 [debug] KernelProvider switched kernel to id = .jvsc74a57bd00a442f27f8d071c54cf9da8e96de746be70f7d203a83f3429e6703b795fb73c7.~/miniconda3/envs/analysis/python.~/miniconda3/envs/analysis/python.-m#ipykernel_launcher 22:47:04.897 [debug] start the kernel, options.disableUI=true for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:47:04.897 [debug] Initialize notebook communications for editor ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:47:04.897 [debug] Resolving notebook UI Comms (resolve) for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:47:04.897 [debug] initialize CommonMessageCoordinator 22:47:04.902 [debug] Registering commtarget jupyter.widget 22:47:04.902 [debug] IPyWidgetMessageDispatcher.initialize 22:47:04.902 [debug] Attempting to determine version of IPyWidgets 22:47:04.903 [debug] Controller selection change completed 22:47:04.903 [debug] Waiting for IPyWidgets version 22:47:04.903 [debug] Waiting for IPyWidgets version promise 22:47:04.997 [debug] Loading kernelspec from ~/Library/Jupyter/kernels/base/kernel.json 22:47:04.997 [debug] Loading kernelspec from ~/Library/Jupyter/kernels/ir/kernel.json 22:47:04.997 [debug] Loading kernelspec from ~/Library/Jupyter/kernels/julia-1.8/kernel.json 22:47:05.009 [debug] Getting activated env variables, Class name = yp (started execution), Arg 1: "~/Documents/Courses/PHYS446/ising", Arg 2: "~/miniconda3/envs/analysis/bin/python", Arg 3: undefined 22:47:05.009 [debug] Get Custom Env Variables, Class name = Rm (started execution), Arg 1: "~/Documents/Courses/PHYS446/ising", Arg 2: "RunPythonCode" 22:47:05.009 [debug] Get Custom Env Variables, Class name = Rm, completed in 0ms, has a truthy return value, Arg 1: "~/Documents/Courses/PHYS446/ising", Arg 2: "RunPythonCode" 22:47:05.009 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd00a442f27f8d071c54cf9da8e96de746be70f7d203a83f3429e6703b795fb73c7.~/miniconda3/envs/analysis/python.~/miniconda3/envs/analysis/python.-m#ipykernel_launcher (Python Path: ~/miniconda3/envs/analysis/bin/python, Conda, analysis, 3.12.2) for '~/Documents/Courses/PHYS446/ising/ising.ipynb' (disableUI=true) 22:47:05.010 [debug] Creating raw notebook for resource '~/Documents/Courses/PHYS446/ising/ising.ipynb' 22:47:05.041 [debug] Loading kernelspec from ~/miniconda3/envs/analysis/share/jupyter/kernels/python3/kernel.json for ~/miniconda3/envs/analysis/bin/python 22:47:05.041 [debug] Loading kernelspec from ~/miniconda3/envs/tmp/share/jupyter/kernels/python3/kernel.json for ~/miniconda3/envs/tmp/bin/python 22:47:05.061 [debug] Getting activated env variables, Class name = yp (started execution), Arg 1: "~/Documents/Courses/PHYS446/ising/ising.ipynb", Arg 2: "~/miniconda3/envs/analysis/bin/python", Arg 3: undefined 22:47:05.061 [debug] Get Custom Env Variables, Class name = Rm (started execution), Arg 1: "~/Documents/Courses/PHYS446/ising/ising.ipynb", Arg 2: "RunPythonCode" 22:47:05.061 [debug] Get Custom Env Variables, Class name = Rm, completed in 0ms, has a truthy return value, Arg 1: "~/Documents/Courses/PHYS446/ising/ising.ipynb", Arg 2: "RunPythonCode" 22:47:05.161 [debug] Hiding default kernel spec 'Python 3 (ipykernel)', 'python3122jvsc74a57bd086ad632078acd5f6a85ed97253effb372ece9df2eed5cd6fb5370310a1c38041', ~/miniconda3/envs/tmp/bin/python for interpreter ~/miniconda3/envs/tmp/bin/python and spec ~/miniconda3/envs/tmp/share/jupyter/kernels/python3/kernel.json 22:47:05.161 [debug] Kernels for interpreter ~/miniconda3/envs/tmp/bin/python are .jvsc74a57bd086ad632078acd5f6a85ed97253effb372ece9df2eed5cd6fb5370310a1c38041.~/miniconda3/envs/tmp/python.~/miniconda3/envs/tmp/python.-m#ipykernel_launcher 22:47:05.161 [debug] Hiding default kernel spec 'Python 3 (ipykernel)', 'python3122jvsc74a57bd00a442f27f8d071c54cf9da8e96de746be70f7d203a83f3429e6703b795fb73c7', ~/miniconda3/envs/analysis/bin/python for interpreter ~/miniconda3/envs/analysis/bin/python and spec ~/miniconda3/envs/analysis/share/jupyter/kernels/python3/kernel.json 22:47:05.163 [debug] Kernels for interpreter ~/miniconda3/envs/analysis/bin/python are .jvsc74a57bd00a442f27f8d071c54cf9da8e96de746be70f7d203a83f3429e6703b795fb73c7.~/miniconda3/envs/analysis/python.~/miniconda3/envs/analysis/python.-m#ipykernel_launcher 22:47:05.313 [debug] Launching kernel .jvsc74a57bd00a442f27f8d071c54cf9da8e96de746be70f7d203a83f3429e6703b795fb73c7.~/miniconda3/envs/analysis/python.~/miniconda3/envs/analysis/python.-m#ipykernel_launcher for ~/Documents/Courses/PHYS446/ising/ising.ipynb in ~/Documents/Courses/PHYS446/ising with ports 9001, 9000, 9004, 9002, 9003 22:47:05.317 [warn] Failed to get activated env vars for /opt/homebrew/bin/python3 in 624ms 22:47:05.317 [debug] Create ProcessService, Class name = Tm (started execution), Arg 1: undefined 22:47:05.317 [debug] Get Custom Env Variables, Class name = Rm (started execution), Arg 1: undefined, Arg 2: "RunNonPythonCode", Arg 3: undefined 22:47:05.318 [debug] Get Custom Env Variables, Class name = Rm, completed in 1ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunNonPythonCode", Arg 3: undefined 22:47:05.318 [debug] Create ProcessService, Class name = Tm, completed in 1ms, has a truthy return value, Arg 1: undefined 22:47:05.319 [info] Process Execution: /opt/homebrew/bin/python3 -c "import site;print("USER_BASE_VALUE");print(site.USER_BASE);print("USER_BASE_VALUE");" 22:47:05.336 [debug] USER_SITE for /opt/homebrew/bin/python3 is ~/Library/Python/3.12/bin 22:47:05.336 [debug] Prepend PATH with user site path for /opt/homebrew/bin/python3, user site ~/Library/Python/3.12/bin 22:47:05.336 [debug] Prepend PATH with python bin for /opt/homebrew/bin/python3 22:47:05.336 [debug] Activated Env Variables for /opt/homebrew/bin/python3, PATH value is /opt/homebrew/bin:~/Library/Python/3.12/bin:~/miniconda3/envs/analysis/bin:~/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/Applications/quarto/bin:/opt/homebrew/bin:~/miniconda3/envs/analysis/bin:~/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/Applications/quarto/bin:/opt/homebrew/bin and Path value is undefined 22:47:05.336 [debug] Getting activated env variables, Class name = yp, completed in 643ms, has a truthy return value, Arg 1: "~/Documents/Courses/PHYS446/ising", Arg 2: "/opt/homebrew/bin/python3", Arg 3: undefined 22:47:05.337 [info] Process Execution: /opt/homebrew/bin/python3 -m pip list 22:47:05.587 [debug] Conda file returned by Python Extension is ~/miniconda3/condabin/conda 22:47:05.719 [debug] Full interpreter list is length: 5, /usr/bin/python3::Unknown:/usr/bin/python3, ~/miniconda3/envs/analysis/bin/python:analysis:Conda:~/miniconda3/envs/analysis/bin/python, ~/miniconda3/bin/python:base:Conda:~/miniconda3/bin/python, ~/miniconda3/envs/tmp/bin/python:tmp:Conda:~/miniconda3/envs/tmp/bin/python, /opt/homebrew/bin/python3::Unknown:/opt/homebrew/bin/python3 22:47:05.719 [debug] Refreshed Environments 22:47:06.985 [debug] Got env vars with python ~/miniconda3/envs/analysis/bin/python, with env var count 98 in 1924ms. PATH value is ~/miniconda3/envs/analysis/bin:~/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/Applications/quarto/bin:/opt/homebrew/bin and Path value is undefined 22:47:06.985 [debug] Prepend PATH with python bin for ~/miniconda3/envs/analysis/bin/python 22:47:06.985 [debug] Activated Env Variables for ~/miniconda3/envs/analysis/bin/python, PATH value is ~/miniconda3/envs/analysis/bin:~/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/Applications/quarto/bin:/opt/homebrew/bin and Path value is undefined 22:47:06.985 [debug] Getting activated env variables, Class name = yp, completed in 1924ms, has a truthy return value, Arg 1: "~/Documents/Courses/PHYS446/ising/ising.ipynb", Arg 2: "~/miniconda3/envs/analysis/bin/python", Arg 3: undefined 22:47:06.986 [info] Process Execution: ~/miniconda3/envs/analysis/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)" 22:47:06.986 [debug] Kernel Env Variables for ~/.vscode/extensions/ms-toolsai.jupyter-2024.2.0-darwin-arm64/temp/jupyter/kernels/python3122jvsc74a57bd00a442f27f8d071c54cf9da8e96de746be70f7d203a83f3429e6703b795fb73c7/kernel.json, PATH value is ~/miniconda3/envs/analysis/bin:~/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/Applications/quarto/bin:/opt/homebrew/bin 22:47:06.987 [info] Process Execution: ~/miniconda3/envs/analysis/bin/python -m ipykernel_launcher --f=~/Library/Jupyter/runtime/kernel-v2-1598WX2ZDeoh2CmJ.json > cwd: ~/Documents/Courses/PHYS446/ising 22:47:06.987 [info] Kernel process 4760. 22:47:06.989 [debug] Got env vars with python ~/miniconda3/envs/analysis/bin/python, with env var count 98 in 1980ms. PATH value is ~/miniconda3/envs/analysis/bin:~/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/Applications/quarto/bin:/opt/homebrew/bin and Path value is undefined 22:47:06.989 [debug] Prepend PATH with python bin for ~/miniconda3/envs/analysis/bin/python 22:47:06.989 [debug] Activated Env Variables for ~/miniconda3/envs/analysis/bin/python, PATH value is ~/miniconda3/envs/analysis/bin:~/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/Applications/quarto/bin:/opt/homebrew/bin and Path value is undefined 22:47:06.989 [debug] Getting activated env variables, Class name = yp, completed in 1980ms, has a truthy return value, Arg 1: "~/Documents/Courses/PHYS446/ising", Arg 2: "~/miniconda3/envs/analysis/bin/python", Arg 3: undefined 22:47:06.990 [info] Process Execution: ~/miniconda3/envs/analysis/bin/python -m pip list 22:47:07.350 [warn] Kernel Spec for 'Base' (~/Library/Jupyter/kernels/base/kernel.json) hidden, as we cannot find a matching interpreter argv = '~/anaconda3/bin/python'. To resolve this, please change '~/anaconda3/bin/python' to point to the fully qualified Python executable. 22:47:07.350 [info] End refreshing Kernel Picker (1710906424588) 22:47:07.401 [debug] ipykernel version & path 6.28.0, ~/miniconda3/envs/analysis/lib/python3.12/site-packages/ipykernel/__init__.py for ~/miniconda3/envs/analysis/bin/python 22:47:07.753 [warn] StdErr from Kernel Process 0.00s - Debugger warning: It seems that frozen modules are being used, which may 0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off 0.00s - to python to disable frozen modules. 0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation. 22:47:07.753 [debug] KernelProcess error: 0.00s - Debugger warning: It seems that frozen modules are being used, which may 0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off 0.00s - to python to disable frozen modules. 0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation. 22:47:07.832 [debug] Kernel output: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work. To exit, you will have to explicitly quit this process, by either sending "quit" from a client, or using Ctrl-\ in UNIX-like environments. To read more about this, see https://github.com/ipython/ipython/issues/2049 To connect another client to this kernel, use: --existing kernel-v2-1598WX2ZDeoh2CmJ.json 22:47:08.005 [debug] Waiting for Raw Session to be ready in postStartRawSession 22:47:08.005 [debug] Waiting for Raw session to be ready, status: connected 22:47:08.005 [debug] Raw session connected 22:47:08.005 [debug] Waiting for Raw session to be ready 22:47:08.005 [debug] Waited for Raw session to be ready & got status: connected 22:47:08.005 [debug] Successfully waited for Raw Session to be ready in postStartRawSession 22:47:08.005 [debug] Kernel status is 'unknown' before requesting kernel info and after ready 22:47:08.005 [debug] Sending request for kernelInfo 22:47:08.010 [debug] Got response for requestKernelInfo 22:47:08.010 [debug] Successfully completed postStartRawSession after 1 attempt(s) in 5ms 22:47:08.011 [debug] Executing silently Code (idle) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys 22:47:08.015 [debug] Executing silently Code (completed) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys with 1 output(s) 22:47:08.015 [debug] End sendTelemetryForPythonKernelExecutable after 4ms 22:47:08.015 [debug] Started running kernel initialization for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:47:08.016 [debug] Executing silently Code (idle) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy 22:47:08.021 [debug] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 0 output(s) 22:47:08.021 [debug] Determined IPyWidgets Version as undefined 22:47:08.022 [debug] Executing silently Code (idle) = def __VSCODE_inject_module():\ndef __VSCODE_call_function(function, callback, data=None): 22:47:08.031 [debug] Executing silently Code (completed) = def __VSCODE_inject_module():\ndef __VSCODE_call_function(function, callback, data=None): with 2 output(s) 22:47:08.031 [debug] Requesting Kernel info 22:47:08.031 [debug] Got Kernel info 22:47:08.031 [debug] End running kernel initialization, now waiting for idle 22:47:08.031 [debug] Waiting for idle on (kernel): 8db53427-6aee-472a-aca9-4ddb98dae338 -> idle 22:47:08.031 [debug] Finished waiting for idle on (kernel): 8db53427-6aee-472a-aca9-4ddb98dae338 -> idle 22:47:08.031 [debug] End running kernel initialization, session is idle 22:47:08.032 [info] Registering Kernel Completion Provider from kernel analysis (Python 3.12.2) for language python 22:47:08.033 [debug] IPyWidgetScriptSource.initialize 22:47:08.033 [debug] IPyWidgetMessageDispatcher.initialize 22:47:08.034 [debug] getDataDirsImpl, Class name = Fr (started execution), Arg 1: "~/Documents/Courses/PHYS446/ising/ising.ipynb", Arg 2: "~/miniconda3/envs/analysis/bin/python" 22:47:08.034 [debug] Get Custom Env Variables, Class name = Rm (started execution), Arg 1: undefined, Arg 2: "RunPythonCode" 22:47:08.034 [debug] Get Custom Env Variables, Class name = Rm, completed in 0ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode" 22:47:08.034 [debug] Jupyter Paths : 22:47:08.035 [info] Process Execution: ~/miniconda3/envs/analysis/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2024.2.0-darwin-arm64/pythonFiles/printJupyterDataDir.py 22:47:08.047 [warn] Got a non-existent Jupyter Data Dir file://~/.local/share/jupyter 22:47:08.047 [debug] getDataDirsImpl, Class name = Fr, completed in 13ms, has a truthy return value, Arg 1: "~/Documents/Courses/PHYS446/ising/ising.ipynb", Arg 2: "~/miniconda3/envs/analysis/bin/python", Return Value: , , , 22:48:03.109 [info] Handle Execution of Cells 0 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:48:03.112 [debug] Cell Index:0 sent to kernel 22:48:03.116 [debug] Start cell 0 execution @ 1710906483116 (clear output) 22:48:03.116 [info] Kernel acknowledged execution of cell 0 @ 1710906483116 22:48:04.009 [info] End cell 0 execution after 0.893s, completed @ 1710906484009, started @ 1710906483116 22:48:04.009 [debug] Cell 0 executed successfully 22:54:22.135 [debug] Jupyter completion time: 3 22:54:23.438 [debug] Jupyter completion time: 6 22:54:27.210 [debug] Jupyter completion time: 4 22:54:37.327 [debug] Jupyter completion time: 3 22:54:42.463 [debug] Jupyter completion time: 5 22:54:55.433 [debug] Jupyter completion time: 4 22:55:21.964 [debug] Jupyter completion time: 4 22:55:25.612 [debug] Jupyter completion time: 6 22:56:58.673 [debug] Jupyter completion time: 3 22:56:59.160 [debug] Jupyter completion time: 3 22:57:15.406 [debug] Jupyter completion time: 3 22:58:15.475 [info] Handle Execution of Cells 1 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:58:15.477 [debug] Cell Index:1 sent to kernel 22:58:15.496 [debug] Start cell 1 execution @ 1710907095496 (clear output) 22:58:15.497 [info] Kernel acknowledged execution of cell 1 @ 1710907095496 22:58:15.509 [info] End cell 1 execution after 0.013s, completed @ 1710907095509, started @ 1710907095496 22:58:15.509 [debug] Cell 1 executed successfully 22:58:22.023 [info] Handle Execution of Cells 2 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:58:22.024 [debug] Cell Index:2 sent to kernel 22:58:22.030 [debug] Start cell 2 execution @ 1710907102030 (clear output) 22:58:22.030 [info] Kernel acknowledged execution of cell 2 @ 1710907102030 22:58:22.542 [info] End cell 2 execution after 0.511s, completed @ 1710907102541, started @ 1710907102030 22:58:22.542 [debug] Cell 2 executed successfully 22:58:25.014 [info] Handle Execution of Cells 3 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:58:25.016 [debug] Cell Index:3 sent to kernel 22:58:25.019 [debug] Start cell 3 execution @ 1710907105019 (clear output) 22:58:25.019 [info] Kernel acknowledged execution of cell 3 @ 1710907105019 22:58:25.023 [info] End cell 3 execution after 0.004s, completed @ 1710907105023, started @ 1710907105019 22:58:25.023 [debug] Cell 3 executed successfully 22:58:27.412 [info] Handle Execution of Cells 5 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:58:27.414 [debug] Cell Index:5 sent to kernel 22:58:27.433 [debug] Start cell 5 execution @ 1710907107433 (clear output) 22:58:27.433 [info] Kernel acknowledged execution of cell 5 @ 1710907107433 22:58:28.181 [info] End cell 5 execution after 0.748s, completed @ 1710907108181, started @ 1710907107433 22:58:28.181 [debug] Cell 5 executed successfully 22:58:29.477 [info] Handle Execution of Cells 6 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:58:29.478 [debug] Cell Index:6 sent to kernel 22:58:29.484 [debug] Start cell 6 execution @ 1710907109484 (clear output) 22:58:29.484 [info] Kernel acknowledged execution of cell 6 @ 1710907109484 22:58:29.766 [info] End cell 6 execution after 0.282s, completed @ 1710907109766, started @ 1710907109484 22:58:29.766 [debug] Cell 6 executed successfully 22:58:37.060 [info] Handle Execution of Cells 8 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:58:37.061 [debug] Cell Index:8 sent to kernel 22:58:37.065 [debug] Start cell 8 execution @ 1710907117065 (clear output) 22:58:37.065 [info] Kernel acknowledged execution of cell 8 @ 1710907117065 22:58:38.135 [info] End cell 8 execution after 1.07s, completed @ 1710907118135, started @ 1710907117065 22:58:38.135 [debug] Cell 8 executed successfully 22:59:05.602 [info] Handle Execution of Cells 9 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:59:05.604 [debug] Cell Index:9 sent to kernel 22:59:05.613 [debug] Start cell 9 execution @ 1710907145613 (clear output) 22:59:05.613 [info] Kernel acknowledged execution of cell 9 @ 1710907145613 22:59:07.259 [info] End cell 9 execution after 1.646s, completed @ 1710907147259, started @ 1710907145613 22:59:07.259 [debug] Cell 9 executed successfully 22:59:27.747 [info] Handle Execution of Cells 10 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 22:59:27.749 [debug] Cell Index:10 sent to kernel 22:59:27.756 [debug] Start cell 10 execution @ 1710907167756 (clear output) 22:59:27.756 [info] Kernel acknowledged execution of cell 10 @ 1710907167756 22:59:27.822 [info] End cell 10 execution after 0.066s, completed @ 1710907167822, started @ 1710907167756 22:59:27.822 [debug] Cell 10 executed successfully 23:00:03.886 [info] Handle Execution of Cells 5 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 23:00:03.888 [debug] Cell Index:5 sent to kernel 23:00:03.892 [debug] Start cell 5 execution @ 1710907203892 (clear output) 23:00:03.892 [info] Kernel acknowledged execution of cell 5 @ 1710907203892 23:00:04.049 [info] End cell 5 execution after 0.157s, completed @ 1710907204049, started @ 1710907203892 23:00:04.049 [debug] Cell 5 executed successfully 23:00:04.442 [info] Handle Execution of Cells 6 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 23:00:04.443 [debug] Cell Index:6 sent to kernel 23:00:04.451 [debug] Start cell 6 execution @ 1710907204451 (clear output) 23:00:04.451 [info] Kernel acknowledged execution of cell 6 @ 1710907204451 23:00:04.703 [info] End cell 6 execution after 0.252s, completed @ 1710907204703, started @ 1710907204451 23:00:04.703 [debug] Cell 6 executed successfully 23:00:07.898 [info] Handle Execution of Cells 8 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 23:00:07.899 [debug] Cell Index:8 sent to kernel 23:00:07.907 [debug] Start cell 8 execution @ 1710907207907 (clear output) 23:00:07.907 [info] Kernel acknowledged execution of cell 8 @ 1710907207907 23:00:08.009 [info] End cell 8 execution after 0.102s, completed @ 1710907208009, started @ 1710907207907 23:00:08.009 [debug] Cell 8 executed successfully 23:00:51.973 [info] Handle Execution of Cells 8 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 23:00:51.974 [debug] Cell Index:8 sent to kernel 23:00:51.979 [debug] Start cell 8 execution @ 1710907251979 (clear output) 23:00:51.980 [info] Kernel acknowledged execution of cell 8 @ 1710907251979 23:00:52.076 [info] End cell 8 execution after 0.096s, completed @ 1710907252075, started @ 1710907251979 23:00:52.076 [debug] Cell 8 executed successfully 23:00:53.037 [info] Handle Execution of Cells 9 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 23:00:53.038 [debug] Cell Index:9 sent to kernel 23:00:53.046 [debug] Start cell 9 execution @ 1710907253046 (clear output) 23:00:53.046 [info] Kernel acknowledged execution of cell 9 @ 1710907253046 23:00:53.324 [info] End cell 9 execution after 0.278s, completed @ 1710907253324, started @ 1710907253046 23:00:53.324 [debug] Cell 9 executed successfully 23:00:55.199 [info] Handle Execution of Cells 10 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 23:00:55.200 [debug] Cell Index:10 sent to kernel 23:00:55.206 [debug] Start cell 10 execution @ 1710907255206 (clear output) 23:00:55.206 [info] Kernel acknowledged execution of cell 10 @ 1710907255206 23:00:55.299 [info] End cell 10 execution after 0.092s, completed @ 1710907255298, started @ 1710907255206 23:00:55.299 [debug] Cell 10 executed successfully 23:01:14.319 [debug] Jupyter completion time: 13 23:01:15.066 [debug] Jupyter completion time: 3 23:01:15.386 [debug] Jupyter completion time: 10 23:01:16.951 [debug] Jupyter completion time: 3 23:01:20.494 [info] Handle Execution of Cells 5 for ~/Documents/Courses/PHYS446/ising/ising.ipynb 23:01:20.496 [debug] Cell Index:5 sent to kernel 23:01:20.501 [debug] Start cell 5 execution @ 1710907280501 (clear output) 23:01:20.501 [info] Kernel acknowledged execution of cell 5 @ 1710907280501 23:01:20.688 [info] End cell 5 execution after 0.187s, completed @ 1710907280688, started @ 1710907280501 23:01:20.688 [debug] Cell 5 executed successfully

Steps to reproduce:

Use vscode to edit literally any .ipynb with a traceback or plot output for more than a few minutes. Provided notebook produces the issue seen in the below videos at some point. The issue may not appear immediately.

Zipped notebook:

ising.ipynb.zip

Slow scrolling:

https://github.com/microsoft/vscode-jupyter/assets/60619834/6f7b6fcb-4914-4142-98bb-3e8d6710b82f

Fast scrolling:

https://github.com/microsoft/vscode-jupyter/assets/60619834/60a79364-4103-4311-ac8d-2d2011363374

amunger commented 6 months ago

I can't repro the behavior, although there is a stutter in the scroll action when that large second cell comes into view. I would suspect that's the actual cause - in that first video, it seems to jump down every time you scroll past the Energy Trace header, which is just below the big cell. Does this still occur if you collapse that cell input? Or have you seen this happen in notebooks without a large cell like that?

gdebrun2 commented 6 months ago

@amunger This behavior occurs in notebooks with no particularly large cells as well. It happens in almost every notebook I'm working in. I'll try to provide a screen cap of it happening nowhere near a large cell. I've experienced this issue by just having a small cell with a traceback output with very little else in the notebook. I should have mentioned previously that I've completely uninstalled vscode and conda to try and fix this to no avail.

The issue is sporadic. It likely won't reproduce immediately on command, but it almost always occurs for me when editing a notebook for an extended period of time.

edit: A more specific scenario occurs when a cell, usually near the end of the notebook but not always, has a traceback output and the output box expands downwards to a ridiculously long size and scrolling will be stuck at this output. This is hard to explain without seeing it, so I'll try to reproduce this.

gdebrun2 commented 6 months ago

@amunger Any update on this? Or advice how to fix it? I would really like to come back to vscode

amunger commented 6 months ago

I haven't been able to reproduce this myself, and I was hoping to see that very long output box you mentioned - Is that an output area that is longer than the stacktrace that it contains?