Tmux doesn’t resize with terminal window

terminaltmux

When I resize a terminal window containing a tmux session, tmux doesn't detect this change, but continues to function normally within the old window boundaries. tmux ls shows no other attached clients before I attach:

$ tmux ls
admin: 1 windows (created Mon Apr 27 15:12:58 2015) [272x75]
apt-runs: 3 windows (created Mon Apr 27 15:17:50 2015) [272x75]
lal-dev: 4 windows (created Tue Jun  9 12:24:25 2015) [238x73]

This only happens with a particular host (running tmux 1.9a), and detaching/reattaching fixes the issue (until the window is resized again). What might be causing this?

Before resize:
Before

After resize:
enter image description here

Best Answer

The easiest thing to do is to detach any other clients from the sessions when you attach:

tmux attach -d

or short

tmux a -d

Alternately, you can move any other clients to a different session before attaching to the session: https://stackoverflow.com/a/7819465/1069083

Related Question