gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.79k stars 3.36k forks source link

history is cleared on ssh connection #634

Closed albttx closed 1 year ago

albttx commented 1 year ago

Once i ssh, i lost my previous history and get a new one from the ssh connection, why that ?

gpakosz commented 1 year ago

Hello @albttx 👋

Hmm I'm afraid it's just how things work when connecting to a remote server with ssh?

albttx commented 1 year ago

Hello,

sorry for my unclear explanation, here is the steps to reproduce

$ ls -l
[...]

$ clear

# here, i can scroll history

$ ssh root@1.1.1.1
[...]

# here, if i have the history if i scroll

root@1.1.1.1:~$ clear

# and now, if i scroll, it's [0/0], no history

Of course, without tmux, it's working.

gpakosz commented 1 year ago

I'm still unsure what you expectations are.

Does it happen if you use tmux without Oh my tmux!? You can try with tmux -L test -f /dev/null to make sure no configuration whatsoever is loaded.

albttx commented 1 year ago

I just find out,

it's because i'm clearing my screen with C-l

# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.2' \; clear-history

So i just added in my tmux.conf.local

unbind -n C-l

Thanks for the help

gpakosz commented 1 year ago

I think you want

bind -n C-l send-keys C-l