Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop ZSH from merging history for all closing tabs?

I use combination of zsh with oh-my-zsh and iTerm2 for development on Mac. I'm frustrated with the following issue:

  • N tabs opened
  • close the terminal
  • reopen it (with Use system Window Restoration Setting)
  • the history from all previously opened tabs got merged into one for every reopened tab

The question: How to preserve separated history for every reopened tab?

like image 229
orkenstein Avatar asked Feb 19 '18 20:02

orkenstein


People also ask

How do you delete ZSH history?

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.

How do I turn on history in ZSH?

To view all the commands stored in your ZSH history file, use the history command. In most cases, the history command will display an extensive list of all your executed commands. You can pipe the output to commands such as grep to search for a specific command or less to navigate it easily.


Video Answer


1 Answers

Per https://github.com/robbyrussell/oh-my-zsh/issues/2537,

Add unsetopt share_history to your .zshrc file.

like image 194
Darren Forsythe Avatar answered Sep 29 '22 20:09

Darren Forsythe