1XPANES(1) XPANES(1)
2
3
4
6 xpanes, tmux-xpanes - Ultimate terminal divider powered by tmux
7
9 Normal mode
10 xpanes [OPTIONS] argument ...
11
12 Pipe mode
13 command ... | xpanes [OPTIONS] [<utility> ...]
14
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
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 --debug
107 Print debug message.
108
109 FORMAT
110 Default value is "[:ARG:].log.%Y-%m-%d_%H-%M-%S".
111 Interpreted sequences are:
112 [:PID:] Process id of the tmux session. (e.g, 41531)
113 [:ARG:] Argument name
114
115 In addition, sequences same as date(1) command are available.
116 For example:
117 %Y year (e.g, 1960)
118 %m month (e.g, 01)
119 %d date (e.g, 31)
120 And etc. Other sequences are available. Please refer to date(1)
121 manual.
122
124 TMUX_XPANES_EXEC
125 Preferentially used as a internal tmux command. Default value
126 is tmux.
127
128 TMUX_XPANES_LOG_DIRECTORY
129 Path to which log files generated by --log option are stored.
130 Default value is $HOME/.cache/xpanes/logs.
131
132 TMUX_XPANES_LOG_FORMAT
133 FORMAT of the log file name generated by --log option. Default
134 value is [:ARG:].log.%Y-%m-%d_%H-%M-%S.
135
136 TMUX_XPANES_PANE_BORDER_FORMAT
137 Defines the format of pane title used in -t option. Default
138 value is #[bg=green,fg=black] #T #[default]. See FORMATS sec‐
139 tion in tmux(1) for further details.
140
141 TMUX_XPANES_PANE_BORDER_STATUS
142 Defines location of the pane's title. See FORMATS section in
143 tmux(1) for further details. Default value is bottom.
144
145 TMUX_XPANES_PANE_DEAD_MESSAGE
146 It defines the message that displayed when a process exits with
147 -s option enabled.
148
149 Default value is \033[41m\033[4m\033[30m Pane is dead: Press
150 [Enter] to exit... \033[0m\033[39m\033[49m.
151
152 TMUX_XPANES_TMUX_VERSION
153 It forces the tmux version recognized by xpanes. It is mainly
154 used for testing purposes. Default value is empty.
155
157 [Normal mode1] Outside of tmux session.
158 When the tmux is not open and xpanes is executed on the normal termi‐
159 nal, the xpanes's behavior is as follows:
160
161 • It newly creates a tmux session and new window on the session.
162
163 • In addition, it separates the window into multiple panes.
164
165 • Finally, the session will be attached.
166
167 [Normal mode2] Inside of tmux session.
168 When the tmux is already open and xpanes is executed on the existing
169 tmux session, the command's behavior is as follows:
170
171 • It newly creates a window on the existing active session.
172
173 • In addition, it separates the window into multiple panes.
174
175 • Finally, the window will be active.
176
177 [Pipe mode] Inside of tmux session & Accepting standard input.
178 When xpanes accepts standard input (i.e, xpanes follows another command
179 and pipe |) under Normal mode2 , xpanes's behavior is going to be the
180 special one called "Pipe mode".
181
182 Pipe mode has two features.
183
184 1 xpanes's argument will be the common command line which
185 will be used within all panes (this is same as the -c op‐
186 tion's argument in Normal mode).
187
188 2 Each line provided by standard input is corresponding to
189 the each pane's command line (this is corresponding to
190 normal argument of xpanes in Normal mode).
191
193 Simple example
194 xpanes 1 2 3 4
195
196 +-------------------------------+-------------------------------+
197 |$ echo 1 |$ echo 2 |
198 |1 |2 |
199 | | |
200 | | |
201 | | |
202 | | |
203 | | |
204 | | |
205 +-------------------------------+-------------------------------+
206 |$ echo 3 |$ echo 4 |
207 |3 |4 |
208 | | |
209 | | |
210 | | |
211 | | |
212 | | |
213 | | |
214 +-------------------------------+-------------------------------+
215
216 -c option and -I option
217 xpanes -I@ -c 'seq @' 1 2 3 4
218
219 +-------------------------------+-------------------------------+
220 |$ seq 1 |$ seq 2 |
221 |1 |1 |
222 | |2 |
223 | | |
224 | | |
225 | | |
226 | | |
227 | | |
228 +-------------------------------+-------------------------------+
229 |$ seq 3 |$ seq 4 |
230 |1 |1 |
231 |2 |2 |
232 |3 |3 |
233 | |4 |
234 | | |
235 | | |
236 | | |
237 +-------------------------------+-------------------------------+
238
239 Ping multiple hosts
240 xpanes -c "ping {}" 192.168.1.{5..8}
241
242 +-------------------------------+-------------------------------+
243 |$ ping 192.168.1.5 |$ ping 192.168.1.6 |
244 | | |
245 | | |
246 | | |
247 | | |
248 | | |
249 | | |
250 | | |
251 +-------------------------------+-------------------------------+
252 |$ ping 192.168.1.7 |$ ping 192.168.1.8 |
253 | | |
254 | | |
255 | | |
256 | | |
257 | | |
258 | | |
259 | | |
260 +-------------------------------+-------------------------------+
261
262 Run commands without opening a login shell
263 xpanes -s -c "seq {}" 2 3 4 5
264
265 +-------------------------------+-------------------------------+
266 |1 |1 |
267 |2 |2 |
268 |Pane is dead: Press [Enter] to |3 |
269 |exit... |Pane is dead: Press [Enter] to |
270 | |exit... |
271 | | |
272 | | |
273 | | |
274 | | |
275 | | |
276 +-------------------------------+-------------------------------+
277 |1 |1 |
278 |2 |2 |
279 |3 |3 |
280 |4 |4 |
281 |Pane is dead: Press [Enter] to |5 |
282 |exit... |Pane is dead: Press [Enter] to |
283 | |exit... |
284 | | |
285 | | |
286 | | |
287 +-------------------------------+-------------------------------+
288
289 Display host always
290 xpanes -t -c "ping {}" 192.168.1.{5..8}
291
292 +-------------------------------+-------------------------------+
293 |$ ping 192.168.1.5 |$ ping 192.168.1.6 |
294 | | |
295 | | |
296 | | |
297 | | |
298 | | |
299 | | |
300 | | |
301 +--192.168.1.5------------------+--192.168.1.6------------------+
302 |$ ping 192.168.1.7 |$ ping 192.168.1.8 |
303 | | |
304 | | |
305 | | |
306 | | |
307 | | |
308 | | |
309 | | |
310 +--192.168.1.7------------------+--192.168.1.8------------------+
311
312 Use SSH without key checking
313 xpanes --ssh myuser1@host1 myuser2@host2
314
315 +-------------------------------+-------------------------------+
316 |$ ssh -o StrictHostKeyChecking |$ ssh -o StrictHostKeyChecking |
317 |=no myuser@host1 |=no myuser@host2 |
318 | | |
319 | | |
320 | | |
321 | | |
322 | | |
323 | | |
324 | | |
325 | | |
326 | | |
327 | | |
328 | | |
329 | | |
330 +-------------------------------+-------------------------------+
331
332 Create new panes on existing window
333 +-------------------------------+-------------------------------+
334 |$ |$ |
335 | | |
336 | | |
337 | | |
338 | | |
339 | | |
340 | | |
341 | | |
342 +-------------------------------+-------------------------------+
343 | $ xpanes -x 4 5 6 |
344 | |
345 | |
346 | |
347 | |
348 | |
349 | |
350 | |
351 +-------------------------------+-------------------------------+
352
353 +-------------------------------+-------------------------------+
354 |$ |$ |
355 | | |
356 | | |
357 | | |
358 | | |
359 +-------------------------------+-------------------------------+
360 |$ xpanes -x 4 5 6 |$ echo 4 |
361 |$ |4 |
362 | |$ |
363 | | |
364 | | |
365 +-------------------------------+-------------------------------+
366 |$ echo 5 |$ echo 6 |
367 |5 |6 |
368 |$ |$ |
369 | | |
370 | | |
371 +-------------------------------+-------------------------------+
372
373 Execute different commands on the different panes
374 xpanes -e "top" "vmstat 1" "watch -n 1 free"
375
376 +-------------------------------+------------------------------+
377 |$ top |$ vmstat 1 |
378 | | |
379 | | |
380 | | |
381 | | |
382 | | |
383 | | |
384 +-------------------------------+------------------------------+
385 |$ watch -n 1 free |
386 | |
387 | |
388 | |
389 | |
390 | |
391 | |
392 +--------------------------------------------------------------+
393
394 Change layout of panes (using presets)
395 xpanes -l ev -c "{}" "top" "vmstat 1" "watch -n 1 df"
396
397 +-------------------------------------------------------------+
398 |$ top |
399 | |
400 | |
401 | |
402 | |
403 +-------------------------------------------------------------+
404 |$ vmstat 1 |
405 | |
406 | |
407 | |
408 | |
409 +-------------------------------------------------------------+
410 |$ watch -n 1 df |
411 | |
412 | |
413 | |
414 | |
415 +-------------------------------------------------------------+
416
417 Change layout of panes (Fixed number of columns)
418 xpanes -C 2 AAA BBB CCC DDD EEE FFF GGG HHH III
419
420 +------------------------------+------------------------------+
421 |$ echo AAA |$ echo BBB |
422 | | |
423 | | |
424 +------------------------------+------------------------------+
425 |$ echo CCC |$ echo DDD |
426 | | |
427 | | |
428 +------------------------------+------------------------------+
429 |$ echo EEE |$ echo FFF |
430 | | |
431 | | |
432 +------------------------------+------------------------------+
433 |$ echo GGG |$ echo HHH |
434 | | |
435 | | |
436 +------------------------------+------------------------------+
437
438 Pipe mode
439 seq 3 | xpanes
440
441 +------------------------------+------------------------------+
442 |$ echo 1 |$ echo 2 |
443 |1 |2 |
444 | | |
445 | | |
446 | | |
447 | | |
448 | | |
449 | | |
450 +------------------------------+------------------------------+
451 |$ echo 3 |
452 |3 |
453 | |
454 | |
455 | |
456 | |
457 | |
458 | |
459 +------------------------------+------------------------------+
460
461 Pipe mode with an argument
462 seq 4 | xpanes seq
463
464 +-------------------------------+------------------------------+
465 |$ seq 1 |$ seq 2 |
466 | | |
467 | | |
468 | | |
469 | | |
470 | | |
471 | | |
472 | | |
473 +-------------------------------+------------------------------+
474 |$ seq 3 |$ seq 4 |
475 | | |
476 | | |
477 | | |
478 | | |
479 | | |
480 | | |
481 | | |
482 +-------------------------------+------------------------------+
483
485 tmux(1)
486
488 Copyright (c) 2021 Yamada, Yasuhiro ⟨yamadagrep@gmail.com⟩ Released un‐
489 der the MIT License. ⟨https://github.com/greymd/tmux-xpanes⟩
490
492 Thanks to Yamada, Yuka for her awesome logo
493 ⟨https://github.com/greymd/tmux-xpanes/wiki/Image-Library⟩.
494
495
496
497User Commands MAR 2021 XPANES(1)