XPANES(1)
π XPANES π
okay bestie, welcome to the manual page for xpanes (aka tmux-xpanes, which is just a lil alias for xpanes, section 1 of the manual, iykyk). she's the ultimate terminal divider powered by tmux. let's get into it π«Ά
β¨ NAME β¨
xpanes, tmux-xpanes β Ultimate terminal divider powered by tmux π
π¦ SYNOPSIS π¦
Normal mode
xpanes [OPTIONS] argument ...
Pipe mode
command ... | xpanes [OPTIONS] [<utility> ...]
π DESCRIPTION π
so xpanes and tmux-xpanes (the alias of xpanes, same girl different name π) do all of this:
- Split tmux window into multiple panes πͺ
- Construct command lines & execute them on the panes
- Runnable from outside of tmux session
- Runnable from inside of tmux session
- Record operation log π
- Flexible layout arrangement for panes
- Select layout presets
- Set columns or rows as you like
- Display pane title on each pane π·οΈ
- Generate command lines from standard input (Pipe mode)
she literally does it all. main character energy, no cap. π
π OPTIONS π
-h,--helpβ show the help and dip out. π-V,--versionβ spit out the version info and bounce.-B <begin-command>β run<begin-command>before it processes<command>in each pane. you can stack this option multiple times, she don't mind. π-c <command>β set<command>to be run in each pane. the default isecho {}.-d,--desyncβ makes thesynchronize-panesoption turn off in the new window. everyone gets to do their own thing, periodt.-eβ execute the given arguments exactly as they are. same as-c '{}'.-I <repstr>β replaces one or more occurrences of<repstr>in the command given by-cor-B. default is{}.-C NUM,--cols=NUMβ how many columns your window layout gets. π-R NUM,--rows=NUMβ how many rows your window layout gets.-l <layout>β set the preset of window layout. the recognized layout arguments are:tβ tiled (the default, the moment)ehβ even-horizontalevβ even-verticalmhβ main-horizontalmvβ main-vertical
-sβ Speedy mode: run the command without opening an interactive shell. πβοΈπ¨-ssβ Speedy mode AND it closes the pane automatically the exact same moment the process exits. two things at once, she's efficient like that.-n <number>β set the maximum number of<argument>taken for each pane.-rβ reuse the existing panes, or create them in the current active window.-S <socket-path>β set a full alternative path to the server socket.-tβ display each argument on each pane's border as their title. cute labels bestie β¨-xβ create extra panes in the current active window.--log[=<directory>]β enable logging and store the log files to~/.cache/xpanes/logsor to<directory>if you gave one.--log-format=<FORMAT>β make the name of the log files follow<FORMAT>.--sshβ same as-t -s -c 'ssh -o StrictHostKeyChecking=no {}'.--stayβ do not switch to the new window. stay put, queen. π--bulk-cols=NUM1[,NUM2 ...]β number of columns on multiple rows (i.e,"2,2,2"represents 2 cols x 3 rows).--interval=<*seconds*>β set the interval between each pane creation and each command execution.sleep(1)is used for the interval. β³--debugβ print debug messages. π
π FORMAT π
the default value is "[:ARG:].log.%Y-%m-%d_%H-%M-%S".
the interpreted sequences are:
[:PID:]β Process id of the tmux session. (e.g,41531)[:ARG:]β Argument name
on top of that, the sequences that work the same as in the date(1) command are available too. for example:
%Yβ year (e.g,1960)%mβ month (e.g,01)%dβ date (e.g,31)- And etc.
other sequences are available as well. please go refer to the date(1) manual for those. π
πΈ SHELL VARIABLES πΈ
TMUX_XPANES_EXECβ preferentially used as an internal tmux command. the default value istmux.TMUX_XPANES_LOG_DIRECTORYβ the path where log files generated by the--logoption get stored. the default value is$HOME/.cache/xpanes/logs.TMUX_XPANES_LOG_FORMATβ theFORMATof the log file name generated by the--logoption. the default value is[:ARG:].log.%Y-%m-%d_%H-%M-%S.TMUX_XPANES_PANE_BORDER_FORMATβ defines the format of the pane title used in the-toption. the default value is#[bg=green,fg=black] #T #[default]. see the FORMATS section intmux(1)for further details.TMUX_XPANES_PANE_BORDER_STATUSβ defines the location of the pane's title. see the FORMATS section intmux(1)for further details. the default value isbottom.TMUX_XPANES_PANE_DEAD_MESSAGEβ it defines the message that gets displayed when a process exits with the-soption enabled.
the default value is \033[41m\033[4m\033[30m Pane is dead: Press [Enter] to exit... \033[0m\033[39m\033[49m.
TMUX_XPANES_TMUX_VERSIONβ it forces the tmux version thatxpanesrecognizes. it's mainly used for testing purposes. the default value is empty.
π§ MODES π§
[Normal mode1] Outside of tmux session
when tmux isn't open and you run xpanes on the normal terminal, here's what she does:
- it newly creates a tmux session and a new window on that session.
- in addition, it separates the window into multiple panes.
- finally, the session will be attached. π«Ά
[Normal mode2] Inside of tmux session
when tmux is already open and you run xpanes on the existing tmux session, the command behaves like this:
- it newly creates a window on the existing active session.
- in addition, it separates the window into multiple panes.
- finally, the window will be active.
[Pipe mode] Inside of tmux session & Accepting standard input
when xpanes accepts standard input (i.e, xpanes follows another command with a pipe |) while under Normal mode2, xpanes's behavior becomes the special one called "Pipe mode". π«
Pipe mode has two features.
xpanes's argument will be the common command line which will be used within all panes (this is same as the-coption's argument in Normal mode).- Each line provided by standard input is corresponding to each pane's command line (this is corresponding to the normal argument of
xpanesin Normal mode).
β EXAMPLES β
Simple example
xpanes 1 2 3 4
+-------------------------------+-------------------------------+
|$ echo 1 |$ echo 2 |
|1 |2 |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
|$ echo 3 |$ echo 4 |
|3 |4 |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
-c option and -I option
xpanes -I@ -c 'seq @' 1 2 3 4
+-------------------------------+-------------------------------+
|$ seq 1 |$ seq 2 |
|1 |1 |
| |2 |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
|$ seq 3 |$ seq 4 |
|1 |1 |
|2 |2 |
|3 |3 |
| |4 |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
Ping multiple hosts
xpanes -c "ping {}" 192.168.1.{5..8}
+-------------------------------+-------------------------------+
|$ ping 192.168.1.5 |$ ping 192.168.1.6 |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
|$ ping 192.168.1.7 |$ ping 192.168.1.8 |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
Run commands without opening a login shell
xpanes -s -c "seq {}" 2 3 4 5
not me leaving you on a cliffhangerβ¦ part 1 of 3, more coming bestie π
...and here's the vibe when a pane is done done π»
+-------------------------------+-------------------------------+
|1 |1 |
|2 |2 |
|Pane is dead: Press [Enter] to |3 |
|exit... |Pane is dead: Press [Enter] to |
| |exit... |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
|1 |1 |
|2 |2 |
|3 |3 |
|4 |4 |
|Pane is dead: Press [Enter] to |5 |
|exit... |Pane is dead: Press [Enter] to |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
Display host always π¦
Bestie, sometimes you just want the host to be visible the whole time, no cap. Like this:
xpanes -t -c "ping {}" 192.168.1.{5..8}
and boom, every pane is wearing its own host as a little name tag π
+-------------------------------+-------------------------------+
|$ ping 192.168.1.5 |$ ping 192.168.1.6 |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+--192.168.1.5------------------+--192.168.1.6------------------+
|$ ping 192.168.1.7 |$ ping 192.168.1.8 |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+--192.168.1.7------------------+--192.168.1.8------------------+
Use SSH without key checking πΈ
You know when SSH stops everything to interrogate you about host keys and you're like girl we don't have time? Same. So:
xpanes --ssh myuser1@host1 myuser2@host2
and what actually lands in each pane is this whole mood:
+-------------------------------+-------------------------------+
|$ ssh -o StrictHostKeyChecking |$ ssh -o StrictHostKeyChecking |
|=no myuser@host1 |=no myuser@host2 |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
Create new panes on existing window β¨
You already have a window open and you're like... actually, what if there were more panes in here? Valid. Obsessed. Let's do it. Starting point:
+-------------------------------+-------------------------------+
|$ |$ |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
| $ xpanes -x 4 5 6 |
| |
| |
| |
| |
| |
| |
| |
+-------------------------------+-------------------------------+
and then, like magic, the whole window rearranges itself into this:
+-------------------------------+-------------------------------+
|$ |$ |
| | |
| | |
| | |
| | |
+-------------------------------+-------------------------------+
|$ xpanes -x 4 5 6 |$ echo 4 |
|$ |4 |
| |$ |
| | |
| | |
+-------------------------------+-------------------------------+
|$ echo 5 |$ echo 6 |
|5 |6 |
|$ |$ |
| | |
| | |
+-------------------------------+-------------------------------+
Execute different commands on the different panes π₯
Why should every pane run the same thing? Let them be individuals. Main character energy for each one:
xpanes -e "top" "vmstat 1" "watch -n 1 free"
+-------------------------------+------------------------------+
|$ top |$ vmstat 1 |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+------------------------------+
|$ watch -n 1 free |
| |
| |
| |
| |
| |
| |
+--------------------------------------------------------------+
Change layout of panes (using presets) π
Not feeling the grid today? Say less. Presets exist and they serve:
xpanes -l ev -c "{}" "top" "vmstat 1" "watch -n 1 df"
stacked, one on top of the other, gorgeous:
+-------------------------------------------------------------+
|$ top |
| |
| |
| |
| |
+-------------------------------------------------------------+
|$ vmstat 1 |
| |
| |
| |
| |
+-------------------------------------------------------------+
|$ watch -n 1 df |
| |
| |
| |
| |
+-------------------------------------------------------------+
Change layout of panes (Fixed number of columns) π§
And if you want to decide how many columns you get, instead of letting the tool decide for you:
xpanes -C 2 AAA BBB CCC DDD EEE FFF GGG HHH III
two columns, as many rows as it takes, no negotiating π
β¦and bestie, the glow-up is immaculate. Four rows, two columns, eight panes, each one chilling with its own lil command:
+------------------------------+------------------------------+
|$ echo AAA |$ echo BBB |
| | |
| | |
+------------------------------+------------------------------+
|$ echo CCC |$ echo DDD |
| | |
| | |
+------------------------------+------------------------------+
|$ echo EEE |$ echo FFF |
| | |
| | |
+------------------------------+------------------------------+
|$ echo GGG |$ echo HHH |
| | |
| | |
+------------------------------+------------------------------+
Like. It's giving window management. It's giving organized. We love to see it. π
π§ Pipe mode
Okay so this one is my fave and I need you to be seated for it. You just pipe stuff straight into xpanes and it turns every line into its own pane, no cap:
seq 3 | xpanes
and boom:
+------------------------------+------------------------------+
|$ echo 1 |$ echo 2 |
|1 |2 |
| | |
| | |
| | |
| | |
| | |
| | |
+------------------------------+------------------------------+
|$ echo 3 |
|3 |
| |
| |
| |
| |
| |
| |
+------------------------------+------------------------------+
Three things in, three panes out. The first two split the top row all cute and even, and then the third one just sprawls across the entire bottom because that's what happens when the math doesn't math to a perfect grid β she's the main character of row two, fr fr. π
π Pipe mode with an argument
Now add one lil argument to the mix and it stops guessing, because you're telling it what to run:
seq 4 | xpanes seq
+-------------------------------+------------------------------+
|$ seq 1 |$ seq 2 |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+------------------------------+
|$ seq 3 |$ seq 4 |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+-------------------------------+------------------------------+
Four values in, four panes out, one perfectly balanced 2Γ2 situation. Symmetry? Slayed. β¨
π SEE ALSO
tmux(1)β the whole reason any of this works, go say hi π«Ά
π AUTHOR AND COPYRIGHT
Copyright (c) 2023 Yamada, Yasuhiro β¨yamada@gr3.ieβ© Released under the MIT License. β¨https://github.com/greymd/tmux-xpanesβ©
Shoutout to the actual legend who made this. Respect the license, bestie β it's MIT, it's generous, don't be weird about it. π
π¦ ACKNOWLEDGEMENTS
Thanks to Yamada, Yuka for her awesome logo β¨https://github.com/greymd/tmux-xpanes/wiki/Image-Libraryβ©.
The logo? Iconic. Genuinely ate. Go look at it, it's in the Image Library. πΈ
And that's the whole page, babe. This was the User Commands manual for XPANES(1), dated MAR 2023. Now go open like forty panes and make something beautiful. πβ¨ππ¦
π¦ where this page comes from
- epel 10: xpanes 4.2.0-4.el10_2 Β· MIT
- fedora 43: xpanes 4.2.0-4.fc43 Β· MIT
- fedora 44: xpanes 4.2.0-5.fc44 Β· MIT
- nixos 26.05: tmux-xpanes 4.2.0
- nixpkgs unstable: tmux-xpanes 4.2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms