microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.62k stars 28.67k forks source link

.ipynb scrolls incorrectly when a cell execution reduces (existing) output #225136

Open p-i- opened 1 month ago

p-i- commented 1 month ago

Type: Bug

Create a fresh .ipynb with 3 cells:

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
for i in range(0):
    i
    print('-\n' * 10)
'foo'
for i in range(10):
    i
    print(f'X\n' * 10)

Execute all. Now replace range(10) with range(0) in the second cell and re-execute that.

You'll notice the display jumps to somewhere near the bottom of the third cell's output.

I'll attach a video.

VS Code version: Code 1.92.0 (b1c0a14de1414fcdaa400695b4db1c0799bc3124, 2024-07-31T23:26:45.634Z) OS version: Darwin arm64 23.5.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M2 (8 x 2400)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|2, 2, 2| |Memory (System)|24.00GB (0.83GB free)| |Process Argv|--crash-reporter-id f10d97cd-2115-4dba-a34a-07be9312995a| |Screen Reader|no| |VM|0%|
Extensions (21) Extension|Author (truncated)|Version ---|---|--- dvt-remote-ssh|ami|1.0.0 nestedtext|bma|2.0.0 githistory|don|0.6.20 copilot|Git|1.221.0 copilot-chat|Git|0.19.2024073102 vsc-python-indent|Kev|1.18.0 rainbow-csv|mec|3.12.0 vscode-docker|ms-|1.29.1 debugpy|ms-|2024.10.0 python|ms-|2024.12.2 vscode-pylance|ms-|2024.8.1 jupyter|ms-|2024.7.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.19 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 remote-containers|ms-|0.380.0 remote-ssh|ms-|0.112.0 remote-ssh-edit|ms-|0.86.0 remote-explorer|ms-|0.4.3 yaml-cloudformation-highlighter|paq|2.0.4 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 vscaac:30438847 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 jg8ic977:31013176 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 refactort:31108082 ccplc:31103425 pythonrstrctxt:31112756 wkspc-onlycs-c:31111717 wkspc-ranged-c:31111712 ```
p-i- commented 1 month ago

https://github.com/user-attachments/assets/d6e4a22b-7677-4240-a0ca-8db314657b04

Crosslinking https://github.com/microsoft/vscode/issues/224045