ZSH iterm2 increase number of lines history
Asked Answered
F

5

163

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?"

Feodor answered 17/9, 2012 at 13:1 Comment(0)
P
405

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

Packsaddle answered 19/2, 2015 at 14:7 Comment(9)
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 ?Seth
This doesn't seem to be the case any more. Does anyone have insight for ~> Build 3.1.5 ?Freese
@Freese 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.Packsaddle
@Packsaddle the option as shown in the picture is no longer available.Freese
FWIW the option is still available for me as of today in iTerm2 v3.2.7Theatricalize
Does this also affect search history?Illiterate
NOTE: ⌘ + , CRASHED iTerm2!!! Please do not do this while running some important scripts.Lilliamlillian
@Lilliamlillian ⌘ + , has been a Mac's keyboard shortcut to open the focused application's preferences (not just Iterm2) since before I started using a Mac, over a decade ago. Perhaps you've setup a keybinding to overwrite the default behavior?Packsaddle
@Packsaddle new mac, no custom settings, might be iterm2 bugLilliamlillian
H
8

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.

Hatbox answered 31/10, 2018 at 21:48 Comment(0)
E
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.

Eldoneldora answered 17/9, 2012 at 15:16 Comment(1)
Not a constructive answer in my opinion.Privatdocent
P
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

Plaything answered 21/2, 2023 at 19:18 Comment(0)
B
0

To enable unlimited scrollback with iTerm2, you can adjust the scrollback settings within iTerm2 preferences. Here's how you can do it:

Open iTerm2 Preferences: Launch iTerm2 if it's not already open. Then, go to the "iTerm2" menu at the top-left corner of the screen and select "Preferences..." Alternatively, you can use the keyboard shortcut Cmd + , to open preferences.

Navigate to Profiles: In the Preferences window, click on the "Profiles" tab at the top.

Select a Profile: Choose the profile you want to modify from the list on the left-hand side. If you're using the default profile, it might be named "Default".

Adjust Scrollback Settings:

  • Within the "Profiles" tab, click on the "Terminal" tab under the selected profile.

  • Scroll down until you see the "Scrollback Buffer" section.

  • You can adjust the "Scrollback lines" slider to set a maximum number of lines if you don't want to use unlimited scrollback.

  • Optionally Check the checkbox next to "Unlimited scrollback".

Apply Changes: Once you've adjusted the scrollback settings to your preference, close the Preferences window. The changes should take effect immediately.

enter image description here

Bindman answered 2/4 at 13:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.