tmux force resize window

With tmux list-client, you can list all clients connected to tmux sessions. For instance:

$ tmux list-client
/dev/pts/6: 0 [25x80 xterm] (utf8)
/dev/pts/8: 0 [25x80 xterm] (utf8)

From this point, you can choose to detach a specified client, or all clients of a specified session. Say I want to detach everyone connected to session 0:

$ tmux detach-client -s 0

Then, you can attach the session so the size will be yours.

Actually, all that can be done with tmux attach -d (the -d option force all other clients to detach).


It is not necessary to detach the other sessions. Use

<c-b>:resize-window -A

to grow the window to the largest connected session.

Other useful parameters to resize-window (resizew) are:

  • -a: resize to the smallest session.
  • -U, -D, -L and -R: adjust up, down, left or right, respectively. Can be followed by a number, determining how much to grow (-D and -R) or shrink (-U and -L).
  • -x <width> and/or -y <height> set width and height to the given values.

if you are already in tmux then you can detach all other connections using :detach-client -a. It leaves your current session only. Consequently you won't have extra space is unusable, filled with ~ characters.

Tags:

Tmux