vscode-jupyter
vscode-jupyter copied to clipboard
Scroll settings are not honored in Native Notebook
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)
]
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.
+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.
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.
@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:
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
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!
Upstream issue https://github.com/microsoft/vscode/issues/118117
@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:
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.
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.
@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:
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.
+1 do you have a good soultion?
+1 The lack of automatic scroll for large outputs is a big pain point compared to standard jupyter.
+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...
@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
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
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!