316

Is there a way to control how many lines can be in the scroll back buffer?

I need a few thousand lines. I'm writing testing code and have extensive output going to a log, but I have simple pass / fail results to the console.

The validations for each test print to the console. I may have 150 to 250 tests per suite, but say 8+ validations per test. I'd rather not open a full terminal window as this integrated environment is cleaning up my screen quite a bit.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Keith
  • 4,129
  • 3
  • 13
  • 25
  • Hi @Keith if any answer has solved your question please consider [accepting it](https://meta.stackexchange.com/q/5234/179419) by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – blues Nov 14 '19 at 15:26
  • For fun you can see [Setting to control the terminal's buffer size #19262](https://github.com/Microsoft/vscode/issues/19262) – Shivam Jha Dec 07 '20 at 15:34

4 Answers4

538
  1. Open preferences
    1. File / Code (Mac)PreferencesSettings.
    2. Ctrl / Cmd (Mac) + Shift + P → search for preferences
  2. Search for scrollback.
  3. Overwrite "terminal.integrated.scrollback": 1000, with whatever you want, e.g. 1000000.
tocallaghan
  • 8,432
  • 1
  • 28
  • 23
  • 8
    Is there a way to set it to _infinite_? – darkdragon Nov 02 '20 at 08:51
  • 4
    Looks like it can't be set to infinite by design - https://github.com/Microsoft/vscode/issues/63452#issuecomment-441796199 – tocallaghan Nov 03 '20 at 05:32
  • 4
    Or pipe the output like this `npm run test 2>&1| tee test-output.txt` – Brian Var Nov 06 '20 at 12:21
  • 6
    in VSCode --> Ctrl + SHIFT + P --> type: settings --> click: "Preferences: Open Settings (JSON)" --> add: `"terminal.integrated.scrollback": 10000,` to increase default by x10 :-) – Wlad Nov 10 '20 at 22:01
  • 3
    This does not change the scrollback size of debug console window, I set it to 1000000, the scrollback of console debug is still about 10000 lines. How to change the debug console scrollback size? – zerox Jul 02 '21 at 02:21
  • At step 1, In my VS Code, there is no File → Preferences. Instead, click on the cog wheel at bottom left of window, and click on Settings. – Jonny Jul 21 '22 at 00:25
  • Adding to @Jonny comment, you can also go to Code → Preferences → Settings. – Yuzobra Feb 08 '23 at 18:38
28

here is how i solved it:

ps: remember to open a new terminal for changes to take effect:

enter image description here

Edwin O.
  • 4,998
  • 41
  • 44
-2

In Settings, set Terminal.integral.scrollback to -1

Andrea
  • 13
  • 1
-3

I think this is a setting of the terminal application you are using, e.g. Terminal.app on OS X or (default) xterm on Linux. If you modify the scrollback limit in those applications it should be reflected in Visual Studio Code.

I opened this to ask the Visual Studio Code guys for verification: Integrated terminal unlimited buffer #14320

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
wilrnh
  • 55
  • 5
  • 7
    should be - but it is not. – ggdx Sep 03 '19 at 10:50
  • 3
    this is indeed very incorrect since vscode verified they use their own terminal emulator. should I go ahead and delete this answer? not sure what the practice is here as a n00b SO user. – wilrnh May 28 '20 at 17:21
  • 5
    I downvoted it to make the score negative which usually serves a sign to not do a thing. Maybe deletion isn't needed -- your answer and associated score may be instructive to future users who read the accepted answer and think for a second they might try to outsmart it (like me) – Info5ek Jun 26 '20 at 17:38