tmux-resurrect icon indicating copy to clipboard operation
tmux-resurrect copied to clipboard

Proposal to hide the input commands saving/restoring bash history:

Open Gullumluvl opened this issue 6 years ago • 4 comments

I configured my tmux to use resurrect save on each detach, but with the option resurrect-save-shell-history ON, this creates a lot of useless "history" lines in my panes. So I created a configuration to hide those commands. It's super experimental, uses unchecked key mappings, so I make this pull request for the reference, but this might need improvement, or another implementation idea.

First, the following must be configured in your ~/.bashrc:

bind -x '"\C-[z": tput smcut'  # Enter a secondary terminal buffer with Alt-z
bind -x '"\C-[Z": tput rmcut'  # Quit it with Alt-Z

Then the tmux sent keys can include those controls around the executed commands to invisibly save/restore the history.

Gullumluvl avatar Mar 27 '19 18:03 Gullumluvl

I'm on ubuntu with the default terminal and this isn't working: I'm getting the following error

tput: unknown terminfo capability 'smcut'

EDIT: seem like you had a typo, and it should be smcup and rmcup

but still there is one annonying things, need to figure how to disable the flickering on change

fruch avatar Jun 15 '20 06:06 fruch

@Gullumluvl I like it, I wish it could be working with definitions only in .tmux.conf and not .bashrc

eventfully I've disable the style changes on bell in my setup, it was too much having all my windows flash every time this command runs

fruch avatar Jun 15 '20 07:06 fruch

My bad, I should have just copy-pasted... I didn't notice the flickering indeed. Thanks for your feedback, I would also like to have all config in one place but could not figure it out...

Gullumluvl avatar Jun 15 '20 13:06 Gullumluvl

Also one this that's annoying with this, is if you type while this kicks in, it messes you current command you are typing, two times this week it happened to me and had to blindly type reset to fix.

Takes a few seconds to figure what's going on

fruch avatar Jun 19 '20 04:06 fruch