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
153 [Normal mode1] Outside of tmux session.
154 When the tmux is not open and xpanes is executed on the normal termi‐
155 nal, the xpanes's behavior is as follows:
156
157 · It newly creates a tmux session and new window on the session.
158
159 · In addition, it separates the window into multiple panes.
160
161 · Finally, the session will be attached.
162
163 [Normal mode2] Inside of tmux session.
164 When the tmux is already open and xpanes is executed on the existing
165 tmux session, the command's behavior is as follows:
166
167 · It newly creates a window on the existing active session.
168
169 · In addition, it separates the window into multiple panes.
170
171 · Finally, the window will be active.
172
173 [Pipe mode] Inside of tmux session & Accepting standard input.
174 When xpanes accepts standard input (i.e, xpanes follows another command
175 and pipe |) under Normal mode2 , xpanes's behavior is going to be the
176 special one called "Pipe mode".
177
178 Pipe mode has two features.
179
180 1 xpanes's argument will be the common command line which
181 will be used within all panes (this is same as the -c
182 option's argument in Normal mode).
183
184 2 Each line provided by standard input is corresponding to
185 the each pane's command line (this is corresponding to
186 normal argument of xpanes in Normal mode).
187
189 Simple example
190 xpanes 1 2 3 4
191
192 +-------------------------------+-------------------------------+
193 |$ echo 1 |$ echo 2 |
194 |1 |2 |
195 | | |
196 | | |
197 | | |
198 | | |
199 | | |
200 | | |
201 +-------------------------------+-------------------------------+
202 |$ echo 3 |$ echo 4 |
203 |3 |4 |
204 | | |
205 | | |
206 | | |
207 | | |
208 | | |
209 | | |
210 +-------------------------------+-------------------------------+
211
212 -c option and -I option
213 xpanes -I@ -c 'seq @' 1 2 3 4
214
215 +-------------------------------+-------------------------------+
216 |$ seq 1 |$ seq 2 |
217 |1 |1 |
218 | |2 |
219 | | |
220 | | |
221 | | |
222 | | |
223 | | |
224 +-------------------------------+-------------------------------+
225 |$ seq 3 |$ seq 4 |
226 |1 |1 |
227 |2 |2 |
228 |3 |3 |
229 | |4 |
230 | | |
231 | | |
232 | | |
233 +-------------------------------+-------------------------------+
234
235 Ping multiple hosts
236 xpanes -c "ping {}" 192.168.1.{5..8}
237
238 +-------------------------------+-------------------------------+
239 |$ ping 192.168.1.5 |$ ping 192.168.1.6 |
240 | | |
241 | | |
242 | | |
243 | | |
244 | | |
245 | | |
246 | | |
247 +-------------------------------+-------------------------------+
248 |$ ping 192.168.1.7 |$ ping 192.168.1.8 |
249 | | |
250 | | |
251 | | |
252 | | |
253 | | |
254 | | |
255 | | |
256 +-------------------------------+-------------------------------+
257
258 Run commands without opening a login shell
259 xpanes -s -c "seq {}" 2 3 4 5
260
261 +-------------------------------+-------------------------------+
262 |1 |1 |
263 |2 |2 |
264 |Pane is dead: Press [Enter] to |3 |
265 |exit... |Pane is dead: Press [Enter] to |
266 | |exit... |
267 | | |
268 | | |
269 | | |
270 | | |
271 | | |
272 +-------------------------------+-------------------------------+
273 |1 |1 |
274 |2 |2 |
275 |3 |3 |
276 |4 |4 |
277 |Pane is dead: Press [Enter] to |5 |
278 |exit... |Pane is dead: Press [Enter] to |
279 | |exit... |
280 | | |
281 | | |
282 | | |
283 +-------------------------------+-------------------------------+
284
285 Display host always
286 xpanes -t -c "ping {}" 192.168.1.{5..8}
287
288 +-------------------------------+-------------------------------+
289 |$ ping 192.168.1.5 |$ ping 192.168.1.6 |
290 | | |
291 | | |
292 | | |
293 | | |
294 | | |
295 | | |
296 | | |
297 +--192.168.1.5------------------+--192.168.1.6------------------+
298 |$ ping 192.168.1.7 |$ ping 192.168.1.8 |
299 | | |
300 | | |
301 | | |
302 | | |
303 | | |
304 | | |
305 | | |
306 +--192.168.1.7------------------+--192.168.1.8------------------+
307
308 Use SSH without key checking
309 xpanes --ssh myuser1@host1 myuser2@host2
310
311 +-------------------------------+-------------------------------+
312 |$ ssh -o StrictHostKeyChecking |$ ssh -o StrictHostKeyChecking |
313 |=no myuser@host1 |=no myuser@host2 |
314 | | |
315 | | |
316 | | |
317 | | |
318 | | |
319 | | |
320 | | |
321 | | |
322 | | |
323 | | |
324 | | |
325 | | |
326 +-------------------------------+-------------------------------+
327
328 Create new panes on existing window
329 +-------------------------------+-------------------------------+
330 |$ |$ |
331 | | |
332 | | |
333 | | |
334 | | |
335 | | |
336 | | |
337 | | |
338 +-------------------------------+-------------------------------+
339 | $ xpanes -x 4 5 6 |
340 | |
341 | |
342 | |
343 | |
344 | |
345 | |
346 | |
347 +-------------------------------+-------------------------------+
348
349 +-------------------------------+-------------------------------+
350 |$ |$ |
351 | | |
352 | | |
353 | | |
354 | | |
355 +-------------------------------+-------------------------------+
356 |$ xpanes -x 4 5 6 |$ echo 4 |
357 |$ |4 |
358 | |$ |
359 | | |
360 | | |
361 +-------------------------------+-------------------------------+
362 |$ echo 5 |$ echo 6 |
363 |5 |6 |
364 |$ |$ |
365 | | |
366 | | |
367 +-------------------------------+-------------------------------+
368
369 Execute different commands on the different panes
370 xpanes -e "top" "vmstat 1" "watch -n 1 free"
371
372 +-------------------------------+------------------------------+
373 |$ top |$ vmstat 1 |
374 | | |
375 | | |
376 | | |
377 | | |
378 | | |
379 | | |
380 +-------------------------------+------------------------------+
381 |$ watch -n 1 free |
382 | |
383 | |
384 | |
385 | |
386 | |
387 | |
388 +--------------------------------------------------------------+
389
390 Change layout of panes (using presets)
391 xpanes -l ev -c "{}" "top" "vmstat 1" "watch -n 1 df"
392
393 +-------------------------------------------------------------+
394 |$ top |
395 | |
396 | |
397 | |
398 | |
399 +-------------------------------------------------------------+
400 |$ vmstat 1 |
401 | |
402 | |
403 | |
404 | |
405 +-------------------------------------------------------------+
406 |$ watch -n 1 df |
407 | |
408 | |
409 | |
410 | |
411 +-------------------------------------------------------------+
412
413 Change layout of panes (Fixed number of columns)
414 xpanes -C 2 AAA BBB CCC DDD EEE FFF GGG HHH III
415
416 +------------------------------+------------------------------+
417 |$ echo AAA |$ echo BBB |
418 | | |
419 | | |
420 +------------------------------+------------------------------+
421 |$ echo CCC |$ echo DDD |
422 | | |
423 | | |
424 +------------------------------+------------------------------+
425 |$ echo EEE |$ echo FFF |
426 | | |
427 | | |
428 +------------------------------+------------------------------+
429 |$ echo GGG |$ echo HHH |
430 | | |
431 | | |
432 +------------------------------+------------------------------+
433
434 Pipe mode
435 seq 3 | xpanes
436
437 +------------------------------+------------------------------+
438 |$ echo 1 |$ echo 2 |
439 |1 |2 |
440 | | |
441 | | |
442 | | |
443 | | |
444 | | |
445 | | |
446 +------------------------------+------------------------------+
447 |$ echo 3 |
448 |3 |
449 | |
450 | |
451 | |
452 | |
453 | |
454 | |
455 +------------------------------+------------------------------+
456
457 Pipe mode with an argument
458 seq 4 | xpanes seq
459
460 +-------------------------------+------------------------------+
461 |$ seq 1 |$ seq 2 |
462 | | |
463 | | |
464 | | |
465 | | |
466 | | |
467 | | |
468 | | |
469 +-------------------------------+------------------------------+
470 |$ seq 3 |$ seq 4 |
471 | | |
472 | | |
473 | | |
474 | | |
475 | | |
476 | | |
477 | | |
478 +-------------------------------+------------------------------+
479
481 tmux(1)
482
484 Copyright (c) 2019 Yamada, Yasuhiro ⟨greengregson@gmail.com⟩ Released
485 under the MIT License. ⟨https://github.com/greymd/tmux-xpanes⟩
486
488 Thanks to Yamada, Yuka for her awesome logo
489 ⟨https://github.com/greymd/tmux-xpanes/wiki/Image-Library⟩.
490
491
492
493User Commands FEB 2019 XPANES(1)