Sharing history between panels / windows

Is there a way to share the history of shell commands between panels / windows in a tmux session?

+7
source share
2 answers

The history of the shell has little to do with tmux; it is related to the shell used. Therefore, if you decide to use zsh, iirc is enabled by default. With bash, you need to add some magic to your .bashrc

 export PROMPT_COMMAND="history -a; history -n" 

this adds your last command to the story and reloads your story after each command. See this post for more information.

+5
source

Add these options to your .zshrc :

 setopt inc_append_history 

I also find hist_ignore_dups hist_ignore_space useful.

See also Zsh "Options" History .

+6
source

Source: https://habr.com/ru/post/924442/


All Articles