vscode-jupyter icon indicating copy to clipboard operation
vscode-jupyter copied to clipboard

Scroll settings are not honored in Native Notebook

Open XiaomoWu opened this issue 4 years ago • 9 comments

Environment data

  • VS Code version: 1.53-insider
  • Jupyter Extension version (available under the Extensions sidebar): 2020.12.414227025
  • Python Extension version (available under the Extensions sidebar): 2020.12.424452561
  • OS (Windows | Mac | Linux distro) and version: Ubuntu 20.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): NA
  • Jupyter server running: Local

Expected behaviour

The cell output will automatically scroll if the output is too long.

Actual behaviour

Cell output never scrolls even if I set:

  • "jupyter.enableScrollingForCellOutputs": true
  • "jupyter.maxOutputSize": 200

Steps to reproduce:

for i in range(10000):
    print(i)

scroll ]

XiaomoWu avatar Jan 15 '21 13:01 XiaomoWu

This is a problem for long lines too: without line wrapping and not being able to scroll sideways, I can't see the whole output.

kjohnsen avatar Jan 15 '21 17:01 kjohnsen

+1. Unless I'm mistaken, I think a previous version, circa ~December 2020, had functional line wrapping and scrolling, so there might've been a regression at some point.

pbotros avatar Jan 18 '21 20:01 pbotros

Currently in VSCode insiders we are moving over to using a new notebook interface provided by VS Code, instead of the old webview interface that we previously used (and still use in stable). There is indeed a bit of a regression here, and those old jupyter vscode settings will no longer apply to the new interface.

We'll discuss in triage, but this might be moved over to the vscode team to fix as they now own scrolling and sizing of output.

IanMatthewHuff avatar Jan 19 '21 19:01 IanMatthewHuff

@XiaomoWu, @pbotros (or anyone else seeing this issue): the latest VS Code insider build automatically truncates long output and provides a link to see all data in a text editor. In the example it looks like this toward the end of the cell output:

image

The default behavior does this for cell output longer than 500 lines. I assume that is too much for your needs? Would adding the maxOutputSize setting to the new notebook interface be sufficient or is the automatic scrolling needed?

Note that the problem of not being able to scroll horizontally is being tracked as a separate VS Code bug: https://github.com/microsoft/vscode/issues/115169

greazer avatar Jan 27 '21 01:01 greazer

Hi @greazer I'm so happy to see the virtual scrolling is back to the Native Editor! Yes 500 lines seem a bit too long, I would expect a more JupyterLab like behavior, like 20 lines or so.

Automatic scrolling with a configurable max lines parameter would definitely be appreciated. It's especially handy when I have long, continuing output, like doing deep nets training. But manually turn on/off for each cell would also be okay for me at the moment.

Thank you for all the hard work that makes VS Code awesome!

XiaomoWu avatar Jan 27 '21 01:01 XiaomoWu

Upstream issue https://github.com/microsoft/vscode/issues/118117

DonJayamanne avatar Mar 15 '21 16:03 DonJayamanne

@XiaomoWu, @pbotros (or anyone else seeing this issue): the latest VS Code insider build automatically truncates long output and provides a link to see all data in a text editor. In the example it looks like this toward the end of the cell output:

image

The default behavior does this for cell output longer than 500 lines. I assume that is too much for your needs? Would adding the maxOutputSize setting to the new notebook interface be sufficient or is the automatic scrolling needed?

Note that the problem of not being able to scroll horizontally is being tracked as a separate VS Code bug: microsoft/vscode#115169

Can you read this? Open the full output data in a text editor can not render exception stack.

image

image

GF-Huang avatar Jul 14 '22 09:07 GF-Huang

Hi, any solution for this? There is no scroll bar and when i open the outputs in another window, it is not readable. I cant read error messages to debug my code :/

Thanks in advance for your amazing work with vscode.

felipemello1 avatar Jul 27 '22 18:07 felipemello1

@XiaomoWu, @pbotros (or anyone else seeing this issue): the latest VS Code insider build automatically truncates long output and provides a link to see all data in a text editor. In the example it looks like this toward the end of the cell output: image The default behavior does this for cell output longer than 500 lines. I assume that is too much for your needs? Would adding the maxOutputSize setting to the new notebook interface be sufficient or is the automatic scrolling needed? Note that the problem of not being able to scroll horizontally is being tracked as a separate VS Code bug: microsoft/vscode#115169

Can you read this? Open the full output data in a text editor can not render exception stack.

image

image

+1 do you have a good soultion?

doveppp avatar Sep 22 '22 12:09 doveppp

+1 The lack of automatic scroll for large outputs is a big pain point compared to standard jupyter.

bycn avatar Nov 03 '22 06:11 bycn

+1 The lack of automatic scroll for large outputs is a big pain point compared to standard jupyter.

I agree. Especially when trying to train larger ML models. Whoever thought of the "open full output in separate txt file (window)" obviously doesn't do any ML work. VSCode's implementation of notebooks is great...for some things...not so great for others...

bstivers avatar Dec 11 '22 11:12 bstivers

@doveppp copying my comment from #10467 about error display-

The workaround is to add this code cell at the start of your notebook

%colors nocolor

This removes the escape codes, like \u001b[0;31m-

If you also want a more compact view of the source code in the traceback, you can add to the same cell

%xmode plain

https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-colors

https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-xmode

r3m0t avatar Feb 23 '23 10:02 r3m0t

This issue was chosen as the solution for https://github.com/microsoft/vscode/issues/153839 which in turn was chosen as duplicate of https://github.com/microsoft/vscode/issues/153855 which got quite a lot of thumbs. I've made a StackOverflow question to help gather good workarounds: https://stackoverflow.com/questions/75607544/how-to-display-formatted-jupyter-stack-trace-from-full-output-data/75607634#75607634

corneliusroemer avatar Mar 01 '23 18:03 corneliusroemer

notebook.output.scrolling can be used to render outputs in scrollable regions rather than being truncated. It is on be default in vs code insiders and will soon be updated in stable.

Please let us know your feedback!

amunger avatar Mar 29 '23 22:03 amunger