155

Not sure if this is zsh, iterm2 or the interaction between them. Trying to change the number of recallable lines in the terminal - not the command history, the output history.

In .zshrc I have :

HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000

This seems to be ignored =(

Not sure of the correct term to google, "Terminal output history?"

studgeek
  • 14,272
  • 6
  • 84
  • 96
xxjjnn
  • 14,591
  • 19
  • 61
  • 94

4 Answers4

387

It's not immediately obvious in the iTerm2 documentation on how to change it.

  • open the iTerm2 preferences + ,
  • select the Profiles tab
  • then select the Terminal subtab
  • Beware, changes to the Scrollback lines value take effect immediately so check Unlimited scrollback now if you don't want to delete your current buffer(s)
  • change the value of the Scrollback Lines to whatever you'd like
  • Uncheck the Unlimited scrollback option if you'd like to use your Scrollback lines value

enter image description here

Travis
  • 13,311
  • 4
  • 26
  • 40
  • Many thanks, I was rather looking for this in the preferences > Advanced tab, and I found a setting "Terminal > Maximum number of lines to expose to Accessibility" Changing this one didn't work, and I'm not really sure what's the difference ? – Cyril Duchon-Doris Oct 19 '16 at 08:35
  • 1
    This doesn't seem to be the case any more. Does anyone have insight for ~> Build 3.1.5 ? – rudolph9 Dec 07 '17 at 17:33
  • @rudolph9 I'm not sure what issues you're having with 3.1.5, but I updated iTerm to the same version and verified that my scrollback lines are still limited to 50k lines. – Travis Dec 07 '17 at 18:37
  • 1
    @Travis the option as shown in the picture is no longer available. – rudolph9 Dec 07 '17 at 19:45
  • 3
    FWIW the option is still available for me as of today in iTerm2 v3.2.7 – Carter Mar 20 '19 at 19:12
  • Does this also affect search history? – Zorayr Sep 09 '20 at 20:51
7

With zsh and iTerm2 Build 3.2.5, an additional step is required: Preferences->Profiles->terminal->check UnlimitedScrollback->Check save lines to scrollback when an app status bar is present

Scrolling was breaking for me without the last one.

jok
  • 263
  • 2
  • 6
4

It's not a shell problem, it's about your terminal emulator.
You have to find the option in the configuration / options / tools / whatever, for the number of lines to remember.

Apparently you know your terminal emulator is iterm2.

Looking for iterm2 on the google will lead you to the official website, then go to 'Documentation', Ctrl+F 'number' and find

Scrollback lines
The number of lines of scrollback buffer to keep above the visible part of the screen.

lolesque
  • 10,693
  • 5
  • 42
  • 42
0

This image below helped me to show all the number of lines from console.log(). Please restart the app and you will be able to see the full lines of logs.

Hope this helps!

enter image description here

Dave Lee
  • 316
  • 3
  • 9