Tmux: Fix terminal size on ssh connection.

Hi there!

From time to time the vi inside telnet inside ssh-connection (yep, it is) racked the sizes of terminal.
And I lived with it… till this day :)

The solution (if it may to be named like that) is: ^]^J~^Zreset;fg^J in short form, and detailed it sounds like: $ # Next keys pressed inside ssh-connection Escape Enter ~ Ctrl-z $ # ssh goes suspend $ reset; fg # return ssh foreground $

For tmux session this combo can be written as: send-keys Escape Enter "~" C-z; run "sleep 1s"; send-keys "reset; fg" Enter; run "sleep 1s"; send-keys Enter; And binding version for tmux-config: bind-key C-r send-keys Escape Enter "~" C-z \; run "sleep 1s" \; send-keys "reset; fg" Enter \; run "sleep 1s" \; send-keys Enter \;


Leave a Reply

Your email address will not be published. Required fields are marked *