'Is there any way to redraw tmux window when switching smaller monitor to bigger one?
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
Solution 1:[1]
You can always press CTRL-B + SHIFT-D to choose which client you want to detach from the session.
tmux will list all sessions with their current dimension. Then you simply detach from all the smaller sized sessions.
Solution 2:[2]
A simpler solution on recent versions of tmux (tested on 1.9) you can now do :
tmux detach -a
-a is for all other client on this session except the current one
You can alias it in your .[bash|zsh]rc
alias takeover="tmux detach -a"
Workflow: You can connect to your session normally, and if you are bothered by another session that forced down your tmux window size you can simply call takeover.
Solution 3:[3]
This is still the top post when searching, but it's no longer valid. Best answer is here, but the TLDR is
<c-b>:resize-window -A
Solution 4:[4]
You can use <Ctrl-B> : + at -d <CR> to redraw the tmux window.
Solution 5:[5]
The other answers did not help me as I only had client attached (the previous one that started the session was already detached).
To fix it I followed the answer here (I was not using xterm).
Which simply said:
- Detach from tmux session
- Run
resizelinux command - Reattach to tmux session
Solution 6:[6]
I just ran into this problem and stumbled across a different situation. Although it's probably just a unicorn, I thought I'd lay it out.
I had one session that was smaller, and I noticed that the font sizes were different: the smaller session had the smaller fonts. Apparently, I had changed window font sizes for some reason.
So in OS X, I just did Cmd-+ on the smaller sized session, and it snapped back into place.
Solution 7:[7]
ps ax | grep tmux
17685 pts/22 S+ 0:00 tmux a -t 13g2
17920 pts/11 S+ 0:00 tmux a -t 13g2
18065 pts/19 S+ 0:00 grep tmux
kill the other one.
Solution 8:[8]
I use Ctrl-b + q which makes it flash number for each pane, redrawing them on the way.
Solution 9:[9]
I had the same problem because of using iTerm's tmux integration (i.e., tmux -CC a).
None of the detach options mentioned in the other answers worked for me, because there was no "other sessions" to detach from.
My understanding is iTerm's tmux client seems to hard set the window size on the attached session, so the subsequent attaches seem to respect the previously resized window size.
Alas, I ended up reattaching iTerm client to tmux via tmux -CC a and manually resized to full window size in GUI (not happy using mouse here, but that is what worked in the end, unfortunately). Clean detach from iTerm and subsequent attaches follows the size set in iTerm.
Solution 10:[10]
Probably an strange edge case but for me the only thing that fixed it was unmaximizing the window and then maximizing it again.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
