I recently switched from bash to zshell but my history does not seem to be working. when I press the up arrow I don't get the previous commands. Is the shortcut different? Also how do I enable shared history through tabs and new windows? I am on Lion, and using the standard Terminal
Increasing the History File Size Unfortunately, zsh's default history file size is limited to 10000 lines by default and will truncate the history to this length by deduplicating entries and removing old data. Adding the following lines to . zshrc will remove the limits and deduplication of the history file.
In my terminal, ZSH, there's a file called ~/. zsh_history , and a similar one for Bash. To remove the command, open that file and remove the entry from the list. Open a new terminal window, and the bad command is gone.
Add this to your .zshrc
:
SAVEHIST=1000 # Save most-recent 1000 lines HISTFILE=~/.zsh_history
To add to user RoboSloNE, if you've double checked that you have set SAVEHIST and HISTFILE via:
$echo $HISTFILE ~/.zsh_history $echo $SAVEHIST 100
Then the next step is to check the permissions of the HISTFILE:
$ls -l $HISTFILE -rw------- 1 user staff 3722 Aug 8 11:29 /Users/user/.zsh_history
Your user need to have read/write access on this file to use it as your history file. I've noticed that installing oh-my-zsh as root will set this file permission to root, so you'll need to:
$chown user:group $HISTFILE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With