On Sat, May 02, 2020 at 09:39:37PM +0530, Sivaram Neelakantan wrote: > I was experimenting with scripting tmux via bash and I got the above > error at the fifth pane creation. I was under the impression that > tmux will auto resize panes to the smallest size and then issue such a > warning when it can no longer fit panes to the visible screen.
No, this has never been the case, tmux will split a pane if it is big enough to split into two without moving other panes. > > --8<---------------cut here---------------start------------->8--- > #!/usr/bin/env bash > > tmux start-server > > tmux new-session -d -s MySession -n Shell1 -d "/usr/bin/env bash -i" > tmux split-window -t MySession:1 "/usr/bin/env bash -i" > tmux split-window -t MySession:1 "/usr/bin/env bash -i" > tmux split-window -t MySession:1 "/usr/bin/env bash -i" > tmux split-window -t MySession:1 "/usr/bin/env bash -c \"echo 'fifth > shell'\"; /usr/bin/env bash -i" > tmux select-layout -t MySession:1 tiled > --8<---------------cut here---------------end--------------->8--- > > 4 panes got created though and I was within the tmux session after > running the script. > > How do I fix this? Relatedly, how do I generalise the script for > various screen sizes of laptops and other screens to fill it up with > panes of a certain size? The easiest things to do are to either make the session big enough to fit all the panes even when they are split: tmux new -d -x 200 -y 200 ... Or to apply the tiled layout after every split (this is what I tend to do): tmux splitw -tMySession:1 ... \; selectl tiled -- You received this message because you are subscribed to the Google Groups "tmux-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/20200502161409.wcwxij7xhsrdtyyp%40yelena.
