New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shell command history messing up when switching windows/slices #1671
Comments
|
This sounds like a Bash problem, not a tmux problem? |
|
found some bugs in the workaround, gonna fix it in the evening |
|
There is no way for tmux to affect the shell history, it is entirely within the shell's control. You will need to ask the Bash developers. |
|
Ok, going to report it there. Just adding the corrected workaround script if someone finds this thread with the same problem (see the notes at the top of the script) |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
My shell command history gets messed up when I switch among the terminals while running long-running commands in them. This happens when
HISTCONTROL=ignorebothis set in .bashrc or whenset -g @resurrect-save-shell-history 'on'is set in .tmux.conf.Since resurrect-save-shell-history is an experimental part of a tmux plugin, I'm going to concern on the basic usecase with
HISTCONTROL=ignorebothset.How I reproduce it:
.bashrc:
.tmux.conf: empty
commands:
tmuxCtrl+C
topCtrl+C (stops
top)prefix+c
lsprefix+0
Up arrow (displays
top)Enter (runs
top)prefix+1
lsprefix+0
Ctrl+C (stops
top)Up arrow (displays
ls, should displaytop)System: Ubuntu 18.04.2 LTS
Terminal: reproduced both in Ubuntu terminal and Konsole
$TERM (inside mux): screen-256color
$TERM (outside mux in both in Ubuntu terminal and Konsole): xterm-256color
tmux -V: tmux next-3.0
logs:
tmux-server-32284.log
Bug does not occur after removing
HISTCONTROL=ignorebothfrom .bashrc.Note: while dealing with this issue I created a hack which overcomes it, so for those who experience similar problems and want to use the command history temporarily while the bug is not fixed, this is a script that performs custom history saving (it uses $HOME/.tmux/resurrect/ path for saved history files to be compatible with @resurrect-save-shell-history but this path can be changed if you don't use tmux_resurrect), just put it into .bashrc. Note2: the history starts working correctly in each individual terminal after executing the first command (ie. " echo >> 0" with the leading space)
tmux_history_bug_hotfix.txt
The text was updated successfully, but these errors were encountered: