microsoft / vscode

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

Set output height limit and scrolling for non-text stream outputs #190426

Open amunger opened 1 year ago

amunger commented 1 year ago

Sometimes the output from a code cell will be very large, which makes it impractical to display the entire output. According to this answer, I tried changing the setting "Notebook>Output: Text Line Limit" ("notebook.output.textLineLimit": 5). However, this seems to only limit the cell size of a pure text based output, and not outputs such as matrices, dataframes or other spreadsheet-like outputs (e.g. from the `View() function in R.)

(NOTE: The cell code is written in R, although I wouldn't presume this to be relevant for this particular issue.)

Example setting:
GUI

enter image description here

(Alternatively) settings.json:
"notebook.output.scrolling": true
"notebook.output.textLineLimit": 5
Example outputs:
Text output

Here the cell is limited to 5 lines, with a vertical scroll bar, as defined in the settings: enter image description here

..but not for matrices, dataframes and spreadsheet-like objects.

Dataframe

enter image description here

Output from View()

enter image description here

My question therefore is:

Is it possible to limit cell height for other outputs than text?

Originally posted by @pehkawn in https://github.com/microsoft/vscode-jupyter/discussions/14113

davies-w commented 4 months ago

Hi, as this hasn't closed yet, I'd like to alert you to the opposite problem - I want to make my Output Window really big - but without having the "inside scroll bar" appearing. Is this a related problem with this variable? In my head, if I set this variable to say 30,000, it should almost never create a second scroll bar, and should just have you scroll down with the primary Notebook Scroll Bar, especially when you use a Mouse with a scroll wheel.

I can do this just fine in Google Colab with some javascript, but here, it seems not. Having Double Scroll Bars is just horrible (imo)

ibobak commented 4 months ago

It is May 2024 now. isn't this problem still fixed? I am also suffering from this.

yitian-reevo commented 1 month ago

Me too, any progress?