Share history between panes/windows

醉酒当歌 提交于 2019-12-06 23:25:24

问题


Is there a way to share the shell command history between panes/windows in a tmux session?


回答1:


shell history has precious little to do with tmux, it has to do with the shell you are using. So if you chose to use zsh it is enabled iirc by default. With bash you need to add some magic to your .bashrc

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

this appends your last command to history and reloads your history after each command. See this post for more information.




回答2:


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.



来源:https://stackoverflow.com/questions/12247777/share-history-between-panes-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!