Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is tmux layout string format?

What's the tmux layout string format in which I can define my custom layout? When I run tmux list-windows in a tmux session it gives me something like:
0: bash* (2 panes) [186x52] [layout 294a,186x52,0,0{93x52,0,0,185,92x52,94,0,186}] @113 (active)
But I want to know what is the format so I can create my custom format to be loaded by something like tmuxp in a config file when starting a new session. I searched the tmux man page and Googled but could not find anything.

like image 583
Masked Man Avatar asked Oct 25 '25 11:10

Masked Man


1 Answers

layout 294a,186x52,0,0{93x52,0,0,185,92x52,94,0,186}
        ↑checksum        ↑pane size | another pane size + coord + id 
               ↑window size   ↑pane coord
                                  ↑pane id

So for this layout, it contains two panes:

  1. 93x52, align at x=0,y=0 and id is %185
  2. 92x52, align at x=94,y=0 and id is %186

Edit:

  • The first 4 hex digits are a checksum, you can find a Perl implementation in: https://metacpan.org/dist/Term-Tmux-Layout/view/bin/tmuxlayout
  • The pane id-s are not relevant, for example if replaced with 0 or mixed up at random (and checksum adjusted as well) select-layout will work just like before. This is a missed opportunity, because:
  • The panes - ordered by pane indices - are placed one for each complete (size,coord1,coord2,id) tuple found in the layout. Unfortunately some tmux commands like move-pane, redistribute pane indices, so they are not as permanent as pane id-s.
like image 109
广西特产风味独特 Avatar answered Oct 27 '25 07:10

广西特产风味独特



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!