Let's say you're connecting to a remote server over ssh with Terminal.app. When you "tmux attach" with bigger resolution monitor from smaller one you previously started tmux, it draws dots around the console. It doesn't fit the new window size. Is there any way to redraw and clean the window? CTRL+L or CTRL–B + R doesn't help. I couldn't find any proper command on man.
% tmux -V
tmux 1.5
Best Answer
tmux limits the dimensions of a window to the smallest of each dimension across all the sessions to which the window is attached. If it did not do this there would be no sensible way to display the whole window area for all the attached clients.
The easiest thing to do is to detach any other clients from the sessions when you attach:
Alternately, you can move any other clients to a different session before attaching to the session:
The screen will shrink again if a smaller client switches to the session.
There is also a variation where you only "take over" the window (link the window into a new session, set
aggressive-resize
, and switch any other sessions that have that window active to some other window), but it is harder to script in the general case (and different to “exit” since you would want to unlink the window or kill the session instead of just detaching from the session).