Skip to content

Autosave interrupts when I'm typing commands in bash #6

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

Closed
davidjb opened this issue May 12, 2015 · 6 comments
Closed

Autosave interrupts when I'm typing commands in bash #6

davidjb opened this issue May 12, 2015 · 6 comments

Comments

@davidjb
Copy link

davidjb commented May 12, 2015

I've got continuum & resurrect installed in my tmux (version 1.9) and it's great (thanks!).

I've encountered an issue that if I'm typing a command and the save interval rolls around, my command is interrupted; with the history -w ... command being injected into the terminal. What I was typing is thus cut off, and I'm presented with an empty prompt.

My settings are:

set -g @continuum-restore 'on'
set -g @continuum-save-interval '60'

which I suppose means there's a chance every hour for this to happen, if I'm typing or have left a command waiting to be run on the terminal.

I'm using the latest version of the plugin from Git at time of writing and stock Bash on Ubuntu 15.04 as my shell.

@bruno-
Copy link
Member

bruno- commented May 12, 2015

Hey,
do you by any chance have set -g @resurrect-save-bash-history 'on'? (an experimental feature from tmux-resurrect plugin)

When that feature is turned on, it does what you describe (inserts history -w..).
So, try fixing this by setting the save bash history feature to off. For example, just do

$ tmux set -g @resurrect-save-bash-history 'off'

in the terminal and the issue should not happen on next save cycle.

Frankly, I find the save bash history feature obnoxious and I'm even thinking of removing it from tmux-resurrect altogether.

@davidjb
Copy link
Author

davidjb commented May 13, 2015

Yes, sorry forgot to mention that option's enabled. I was slightly dubious about not having the history saved, but on balance, my tmux session and computer rarely get restarted anyway so turning this off won't be as big an issue as I'd first thought.

Out of interest, why do you consider the history feature obnoxious?

@bruno-
Copy link
Member

bruno- commented May 13, 2015

Hey, okay cool!

I dislike the history feature because it's not clean. In both the save and restore steps it sends commands to the working panes (what you experienced). This changes what the user sees and interrupts the workflow. From what I know no other option is that intrusive.

But hey, maybe it's just me.

@davidjb
Copy link
Author

davidjb commented May 13, 2015

I very much agree; I could accept the occasional interjection of the save/restore commands as a once off but on a repeated basis, it's a real pain.

Could you do something like changing Bash's $PROMPT_COMMAND to save after each command into the pane history file? Or perhaps manipulate Bash's $HISTFILE (on shell startup) to point the specific file for each pane? Not sure manipulating environment variables like this is feasible in tmux, but changing the .bashrc to reference a tmux-specific function would seemingly be an option.

@bruno-
Copy link
Member

bruno- commented May 23, 2015

Hey @davidjb,
I'd accept a pull request to tmux-resurrect that improves the "quality" of this feature..
I personally don't feel very motivated to work on this as I don't use the feature. If there's help needed I'll be glad to help though.

@bruno-
Copy link
Member

bruno- commented Jul 7, 2015

We have this issue logged in tmux-resurrect. As this issue is more related to that project, I'll leave that one open and close this.

@bruno- bruno- closed this as completed Jul 7, 2015
tp5uiuc added a commit to tp5uiuc/dotfiles that referenced this issue Dec 31, 2021
By storing history, it injects a command in our workflow
and breaks what Im typing, which is annoying

Also increased restore time to 30 minutes from 20.

tmux-plugins/tmux-continuum#6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants