0

I have a tmux session created in detach mode and I ran a series tmux commands in a script to ceate panes and resize panes but when trying to attach to the session, panes are in different size, if in that, I run the same commands to resize panes in the script, panes' size resize correctly.

Why in detach mode and resize panes result incorrectly?

EDIT: I guess tmux resized panes when client attach.

0

tmux changes size of panes depending on size of terminal (the smallest width and the smallest height of all clients). When is tmux attached to terminal with same size as before, the panes have same size. When it is attached to terminal with different size, it is changed proportionally. (If you have two panes of width 20 and 60 in terminal with width 80 and the attached session uses terminal with width 40, new width of panes will be 10 and 30.)

If you want to keep the size, attach it to terminal with same size.

When are multiple clients attached, it is also resized: (some parts are removed from image)

multiple tmux clients

  • I create in detach mode and attach latter with the same client, or it's just the first time client to connect to tmux session. – Tuyen Pham Oct 15 '18 at 0:09
  • It is resized every time the client connects. When connected, tmux resizes the session to size that can all clients show. When the size is different, panes are resized proportionally. When is the size same, it is not resized. – jiwopene Oct 15 '18 at 6:05
  • I created session in detach mode and connect to the specific window then split -h and -v to setup layout then attach to session for the first time, the size of panes are not setup correctly, how to prevent it? There's must be default for panes' size when not connected to a client? – Tuyen Pham Oct 15 '18 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.