1XPANES(1)                                                            XPANES(1)
2
3
4

NAME

6       xpanes, tmux-xpanes - Ultimate terminal divider powered by tmux
7

SYNOPSIS

9   Normal mode
10       xpanes [OPTIONS] argument ...
11
12   Pipe mode
13       command ... | xpanes [OPTIONS] [<utility> ...]
14

DESCRIPTION

16       xpanes  and  tmux-xpanes (alias of xpanes) commands have following fea‐
17       tures.
18
19              • Split tmux window into multiple panes
20
21                • Construct command lines & execute them on the panes
22
23              • Runnable from outside of tmux session
24
25              • Runnable from inside of tmux session
26
27              • Record operation log
28
29              • Flexible layout arrangement for panes
30
31                • Select layout presets
32
33                • Set columns or rows as you like
34
35              • Display pane title on each pane
36
37              • Generate command lines from standard input (Pipe mode)
38

OPTIONS

40       -h, --help
41              Display the help and exit.
42
43       -V, --version
44              Output version information and exit.
45
46       -B <begin-command>
47              Run <begin-command> before processing <command>  in  each  pane.
48              Multiple options are allowed.
49
50       -c <command>
51              Set <command> to be executed in each pane. Default is echo {}.
52
53       -d, --desync
54              Make synchronize-panes option off in new window.
55
56       -e     Execute given arguments as is. Same as -c '{}'
57
58       -I <repstr>
59              Replacing  one  or  more occurrences of <repstr> in command pro‐
60              vided by -c or -B. Default is {}.
61
62       -C NUM, --cols=NUM
63              Number of columns of window layout.
64
65       -R NUM, --rows=NUM
66              Number of rows of window layout.
67
68       -l <layout>
69         Set the preset of window layout. Recognized layout arguments are:
70           t    tiled (default)
71           eh   even-horizontal
72           ev   even-vertical
73           mh   main-horizontal
74           mv   main-vertical
75
76       -s     Speedy mode: Run command without opening an interactive shell.
77
78       -ss    Speedy mode AND close a pane automatically at the same  time  as
79              process exiting.
80
81       -n <number>
82              Set the maximum number of <argument> taken for each pane.
83
84       -S <socket-path>
85              Set a full alternative path to the server socket.
86
87       -t     Display each argument on the each pane's border as their title.
88
89       -x     Create extra panes in the current active window.
90
91       --log[=<directory>]
92              Enable  logging  and  store log files to ~/.cache/xpanes/logs or
93              <directory>.
94
95       --log-format=<FORMAT>
96              Make name of log files follow <FORMAT>.
97
98       --ssh  Same as -t -s -c 'ssh -o StrictHostKeyChecking=no {}'.
99
100       --stay Do not switch to new window.
101
102       --bulk-cols=NUM1[,NUM2 ...]
103              Number of columns on multiple rows (i.e,  "2,2,2"  represents  2
104              cols x 3 rows).
105
106       --interval=<*seconds*>
107              Set  interval between each pane creation and each command execu‐
108              tion.  sleep(1) is used for the interval.
109
110       --debug
111              Print debug message.
112
113   FORMAT
114       Default value is "[:ARG:].log.%Y-%m-%d_%H-%M-%S".
115         Interpreted sequences are:
116           [:PID:]   Process id of the tmux session. (e.g, 41531)
117           [:ARG:]   Argument name
118
119       In addition, sequences same as date(1) command are available.
120         For example:
121           %Y   year  (e.g, 1960)
122           %m   month (e.g, 01)
123           %d   date  (e.g, 31)
124           And etc.  Other sequences are available. Please  refer  to  date(1)
125       manual.
126

SHELL VARIABLES

128       TMUX_XPANES_EXEC
129              Preferentially  used  as a internal tmux command.  Default value
130              is tmux.
131
132       TMUX_XPANES_LOG_DIRECTORY
133              Path to which log files generated by --log  option  are  stored.
134              Default value is $HOME/.cache/xpanes/logs.
135
136       TMUX_XPANES_LOG_FORMAT
137              FORMAT  of the log file name generated by --log option.  Default
138              value is [:ARG:].log.%Y-%m-%d_%H-%M-%S.
139
140       TMUX_XPANES_PANE_BORDER_FORMAT
141              Defines the format of pane title used  in  -t  option.   Default
142              value  is  #[bg=green,fg=black] #T #[default].  See FORMATS sec‐
143              tion in tmux(1) for further details.
144
145       TMUX_XPANES_PANE_BORDER_STATUS
146              Defines location of the pane's title.  See  FORMATS  section  in
147              tmux(1) for further details.  Default value is bottom.
148
149       TMUX_XPANES_PANE_DEAD_MESSAGE
150              It  defines the message that displayed when a process exits with
151              -s option enabled.
152
153              Default value is \033[41m\033[4m\033[30m  Pane  is  dead:  Press
154              [Enter] to exit... \033[0m\033[39m\033[49m.
155
156       TMUX_XPANES_TMUX_VERSION
157              It  forces  the tmux version recognized by xpanes.  It is mainly
158              used for testing purposes.  Default value is empty.
159

MODES

161   [Normal mode1] Outside of tmux session.
162       When the tmux is not open and xpanes is executed on the  normal  termi‐
163       nal, the xpanes's behavior is as follows:
164
165              • It newly creates a tmux session and new window on the session.
166
167              • In addition, it separates the window into multiple panes.
168
169              • Finally, the session will be attached.
170
171   [Normal mode2] Inside of tmux session.
172       When  the  tmux  is already open and xpanes is executed on the existing
173       tmux session, the command's behavior is as follows:
174
175              • It newly creates a window on the existing active session.
176
177              • In addition, it separates the window into multiple panes.
178
179              • Finally, the window will be active.
180
181   [Pipe mode] Inside of tmux session & Accepting standard input.
182       When xpanes accepts standard input (i.e, xpanes follows another command
183       and  pipe  |) under Normal mode2 , xpanes's behavior is going to be the
184       special one called "Pipe mode".
185
186       Pipe mode has two features.
187
188              1      xpanes's argument will be the common command  line  which
189                     will be used within all panes (this is same as the -c op‐
190                     tion's argument in Normal mode).
191
192              2      Each line provided by standard input is corresponding  to
193                     the  each  pane's  command line (this is corresponding to
194                     normal argument of xpanes in Normal mode).
195

EXAMPLES

197   Simple example
198       xpanes 1 2 3 4
199
200              +-------------------------------+-------------------------------+
201              |$ echo 1                       |$ echo 2                       |
202              |1                              |2                              |
203              |                               |                               |
204              |                               |                               |
205              |                               |                               |
206              |                               |                               |
207              |                               |                               |
208              |                               |                               |
209              +-------------------------------+-------------------------------+
210              |$ echo 3                       |$ echo 4                       |
211              |3                              |4                              |
212              |                               |                               |
213              |                               |                               |
214              |                               |                               |
215              |                               |                               |
216              |                               |                               |
217              |                               |                               |
218              +-------------------------------+-------------------------------+
219
220   -c option and -I option
221       xpanes -I@ -c 'seq @' 1 2 3 4
222
223              +-------------------------------+-------------------------------+
224              |$ seq 1                        |$ seq 2                        |
225              |1                              |1                              |
226              |                               |2                              |
227              |                               |                               |
228              |                               |                               |
229              |                               |                               |
230              |                               |                               |
231              |                               |                               |
232              +-------------------------------+-------------------------------+
233              |$ seq 3                        |$ seq 4                        |
234              |1                              |1                              |
235              |2                              |2                              |
236              |3                              |3                              |
237              |                               |4                              |
238              |                               |                               |
239              |                               |                               |
240              |                               |                               |
241              +-------------------------------+-------------------------------+
242
243   Ping multiple hosts
244       xpanes -c "ping {}" 192.168.1.{5..8}
245
246              +-------------------------------+-------------------------------+
247              |$ ping 192.168.1.5             |$ ping 192.168.1.6             |
248              |                               |                               |
249              |                               |                               |
250              |                               |                               |
251              |                               |                               |
252              |                               |                               |
253              |                               |                               |
254              |                               |                               |
255              +-------------------------------+-------------------------------+
256              |$ ping 192.168.1.7             |$ ping 192.168.1.8             |
257              |                               |                               |
258              |                               |                               |
259              |                               |                               |
260              |                               |                               |
261              |                               |                               |
262              |                               |                               |
263              |                               |                               |
264              +-------------------------------+-------------------------------+
265
266   Run commands without opening a login shell
267       xpanes -s -c "seq {}" 2 3 4 5
268
269              +-------------------------------+-------------------------------+
270              |1                              |1                              |
271              |2                              |2                              |
272              |Pane is dead: Press [Enter] to |3                              |
273              |exit...                        |Pane is dead: Press [Enter] to |
274              |                               |exit...                        |
275              |                               |                               |
276              |                               |                               |
277              |                               |                               |
278              |                               |                               |
279              |                               |                               |
280              +-------------------------------+-------------------------------+
281              |1                              |1                              |
282              |2                              |2                              |
283              |3                              |3                              |
284              |4                              |4                              |
285              |Pane is dead: Press [Enter] to |5                              |
286              |exit...                        |Pane is dead: Press [Enter] to |
287              |                               |exit...                        |
288              |                               |                               |
289              |                               |                               |
290              |                               |                               |
291              +-------------------------------+-------------------------------+
292
293   Display host always
294       xpanes -t -c "ping {}" 192.168.1.{5..8}
295
296              +-------------------------------+-------------------------------+
297              |$ ping 192.168.1.5             |$ ping 192.168.1.6             |
298              |                               |                               |
299              |                               |                               |
300              |                               |                               |
301              |                               |                               |
302              |                               |                               |
303              |                               |                               |
304              |                               |                               |
305              +--192.168.1.5------------------+--192.168.1.6------------------+
306              |$ ping 192.168.1.7             |$ ping 192.168.1.8             |
307              |                               |                               |
308              |                               |                               |
309              |                               |                               |
310              |                               |                               |
311              |                               |                               |
312              |                               |                               |
313              |                               |                               |
314              +--192.168.1.7------------------+--192.168.1.8------------------+
315
316   Use SSH without key checking
317       xpanes --ssh myuser1@host1 myuser2@host2
318
319              +-------------------------------+-------------------------------+
320              |$ ssh -o StrictHostKeyChecking |$ ssh -o StrictHostKeyChecking |
321              |=no myuser@host1               |=no myuser@host2               |
322              |                               |                               |
323              |                               |                               |
324              |                               |                               |
325              |                               |                               |
326              |                               |                               |
327              |                               |                               |
328              |                               |                               |
329              |                               |                               |
330              |                               |                               |
331              |                               |                               |
332              |                               |                               |
333              |                               |                               |
334              +-------------------------------+-------------------------------+
335
336   Create new panes on existing window
337              +-------------------------------+-------------------------------+
338              |$                              |$                              |
339              |                               |                               |
340              |                               |                               |
341              |                               |                               |
342              |                               |                               |
343              |                               |                               |
344              |                               |                               |
345              |                               |                               |
346              +-------------------------------+-------------------------------+
347              | $ xpanes -x 4 5 6                                             |
348              |                                                               |
349              |                                                               |
350              |                                                               |
351              |                                                               |
352              |                                                               |
353              |                                                               |
354              |                                                               |
355              +-------------------------------+-------------------------------+
356
357              +-------------------------------+-------------------------------+
358              |$                              |$                              |
359              |                               |                               |
360              |                               |                               |
361              |                               |                               |
362              |                               |                               |
363              +-------------------------------+-------------------------------+
364              |$ xpanes -x 4 5 6              |$ echo 4                       |
365              |$                              |4                              |
366              |                               |$                              |
367              |                               |                               |
368              |                               |                               |
369              +-------------------------------+-------------------------------+
370              |$ echo 5                       |$ echo 6                       |
371              |5                              |6                              |
372              |$                              |$                              |
373              |                               |                               |
374              |                               |                               |
375              +-------------------------------+-------------------------------+
376
377   Execute different commands on the different panes
378       xpanes -e "top" "vmstat 1" "watch -n 1 free"
379
380              +-------------------------------+------------------------------+
381              |$ top                          |$ vmstat 1                    |
382              |                               |                              |
383              |                               |                              |
384              |                               |                              |
385              |                               |                              |
386              |                               |                              |
387              |                               |                              |
388              +-------------------------------+------------------------------+
389              |$ watch -n 1 free                                             |
390              |                                                              |
391              |                                                              |
392              |                                                              |
393              |                                                              |
394              |                                                              |
395              |                                                              |
396              +--------------------------------------------------------------+
397
398   Change layout of panes (using presets)
399       xpanes -l ev -c "{}" "top" "vmstat 1" "watch -n 1 df"
400
401              +-------------------------------------------------------------+
402              |$ top                                                        |
403              |                                                             |
404              |                                                             |
405              |                                                             |
406              |                                                             |
407              +-------------------------------------------------------------+
408              |$ vmstat 1                                                   |
409              |                                                             |
410              |                                                             |
411              |                                                             |
412              |                                                             |
413              +-------------------------------------------------------------+
414              |$ watch -n 1 df                                              |
415              |                                                             |
416              |                                                             |
417              |                                                             |
418              |                                                             |
419              +-------------------------------------------------------------+
420
421   Change layout of panes (Fixed number of columns)
422       xpanes -C 2 AAA BBB CCC DDD EEE FFF GGG HHH III
423
424              +------------------------------+------------------------------+
425              |$ echo AAA                    |$ echo BBB                    |
426              |                              |                              |
427              |                              |                              |
428              +------------------------------+------------------------------+
429              |$ echo CCC                    |$ echo DDD                    |
430              |                              |                              |
431              |                              |                              |
432              +------------------------------+------------------------------+
433              |$ echo EEE                    |$ echo FFF                    |
434              |                              |                              |
435              |                              |                              |
436              +------------------------------+------------------------------+
437              |$ echo GGG                    |$ echo HHH                    |
438              |                              |                              |
439              |                              |                              |
440              +------------------------------+------------------------------+
441
442   Pipe mode
443       seq 3 | xpanes
444
445              +------------------------------+------------------------------+
446              |$ echo 1                      |$ echo 2                      |
447              |1                             |2                             |
448              |                              |                              |
449              |                              |                              |
450              |                              |                              |
451              |                              |                              |
452              |                              |                              |
453              |                              |                              |
454              +------------------------------+------------------------------+
455              |$ echo 3                                                     |
456              |3                                                            |
457              |                                                             |
458              |                                                             |
459              |                                                             |
460              |                                                             |
461              |                                                             |
462              |                                                             |
463              +------------------------------+------------------------------+
464
465   Pipe mode with an argument
466       seq 4 | xpanes seq
467
468              +-------------------------------+------------------------------+
469              |$ seq 1                        |$ seq 2                       |
470              |                               |                              |
471              |                               |                              |
472              |                               |                              |
473              |                               |                              |
474              |                               |                              |
475              |                               |                              |
476              |                               |                              |
477              +-------------------------------+------------------------------+
478              |$ seq 3                        |$ seq 4                       |
479              |                               |                              |
480              |                               |                              |
481              |                               |                              |
482              |                               |                              |
483              |                               |                              |
484              |                               |                              |
485              |                               |                              |
486              +-------------------------------+------------------------------+
487

SEE ALSO

489       tmux(1)
490
492       Copyright (c) 2023 Yamada, Yasuhiro ⟨yamada@gr3.ie⟩ Released under  the
493       MIT License.  ⟨https://github.com/greymd/tmux-xpanes
494

ACKNOWLEDGEMENTS

496       Thanks     to     Yamada,     Yuka     for     her     awesome     logo
497https://github.com/greymd/tmux-xpanes/wiki/Image-Library⟩.
498
499
500
501User Commands                      MAR 2023                          XPANES(1)
Impressum