tmux-xpanes: fanning one command across a grid of tmux panes
Awesome tmux-based terminal divider
At a glance
- What is it?
- tmux-xpanes is a shell script that takes one command template and a list of arguments, opens a tmux pane per argument, and runs the substituted command in each. It adds logging, layout presets, and a pipe mode on top of what tmux alone provides.
- Who is it for?
- tmux-xpanes suits engineers who repeatedly run the same command against a changing set of hosts or containers and want the output visible side by side. The template flag, pipe mode, and built-in logging cover most fleet-inspection workflows without a wrapper script.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 171 days ago.
- What is it written in?
- Mainly Shell, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 6, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The {} placeholder fans one command out to every argument in parallel
At the centre of xpanes is a substitution placeholder. You write one command template containing `{}`, pass a list of arguments, and xpanes opens one pane per argument, substitutes each argument into the template, and runs the result.
$ xpanes -c "ping {}" 192.168.0.{1..9}Nine panes open, each running ping against one address in that range. The -I option lets you swap the default placeholder for a different string if the command you need to template already uses curly braces.
Two commands come with every installation: `xpanes` and `tmux-xpanes`. The README states they are the same command, with `tmux-xpanes` being an alias of `xpanes`.
Synchronise-panes is on by default, meaning keystrokes reach all panes at once. Passing -d turns that off when each pane should respond to input independently. Use -x to place new panes in the current active window instead of a fresh one, and `--stay` to keep focus on the existing window while the new one opens in the background.
Homebrew, dnf, apt with a PPA, or a single downloaded script file
On macOS, Homebrew handles the install in one line:
$ brew install tmux-xpanesOn Fedora, the package sits in the default repositories:
$ sudo dnf install xpanesUbuntu requires adding a PPA first, since tmux-xpanes is not in the standard Ubuntu repositories:
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:greymd/tmux-xpanes
$ sudo apt update
$ sudo apt install tmux-xpanesDebian users download the .deb file directly; the README gives the v4.2.0 path:
$ wget https://github.com/greymd/tmux-xpanes/releases/download/v4.2.0/tmux-xpanes_v4.2.0.deb
$ sudo dpkg -i tmux-xpanes*.deb
$ rm tmux-xpanes*.debA manual path skips every package manager entirely, downloading the single shell script and placing it in PATH:
$ wget https://raw.githubusercontent.com/greymd/tmux-xpanes/v4.2.0/bin/xpanes -O ./xpanes
$ sudo install -m 0755 xpanes /usr/local/bin/xpanesBecause xpanes is a single script, the manual path works on any system with Bash and tmux. Zsh plugin managers like zplug are also supported, but tmux must be installed separately when going that route.
Seven layout presets, with mhm and mvm gated on tmux 3.5 or newer
Once panes are open, the -l flag selects a window layout preset. Seven options are available: t (tiled), eh (even-horizontal), ev (even-vertical), mh (main-horizontal), mv (main-vertical), mhm (main-horizontal-mirror), and mvm (main-vertical-mirror). The options table marks the last two with `tmux 3.5+`.
That annotation does not appear in the requirements section, which only states tmux 1.8 or later as the minimum. A system that satisfies the stated requirements but runs a tmux version before 3.5 cannot use either mirror preset. Because the minimum version and the feature gate appear in separate parts of the README, it is easy to overlook the dependency.
For fixed-count layouts, the flags `--cols=NUM` and `--rows=NUM` set column and row counts directly. The `--bulk-cols` option accepts a comma-separated list such as `2,2,2`, which produces three rows with two columns each, letting you define an uneven grid without resizing panes afterward. The flag `-n <number>` sets how many arguments each pane receives, which changes the total pane count when the argument list does not divide evenly.
Pipe mode builds the argument list from standard input at runtime
When the argument list is not fixed at invocation time, pipe mode accepts it from standard input. The usage line reads `command ... | xpanes [OPTIONS] [<command> ...]`. A Docker example from the README shows it in practice:
$ docker ps -q | xpanes -s -c "docker exec -it {} sh"Each container ID printed by `docker ps -q` becomes one substitution. Pane count therefore matches the number of running containers at that moment. Without pipe mode, the equivalent setup requires collecting the IDs in a separate step and passing them as positional arguments.
Pipe mode accepts the same flags as normal mode. Adding -t to the example above would display each container ID on the pane border as a title, which makes the grid readable when all the prompts look the same. The -B flag runs a setup command in each pane before the main -c command executes, and multiple -B options are allowed on the same invocation.
The --ssh shortcut expands to StrictHostKeyChecking=no, a security detail the README only states in the options table
SSH across many hosts is a common use case, and xpanes provides a shortcut. The options table states exactly what `--ssh` expands to: `-t -s -c 'ssh -o StrictHostKeyChecking=no {}'`. The `StrictHostKeyChecking=no` part tells the SSH client to accept any host key without verifying it against a previously stored value.
That means no confirmation prompt appears when connecting to a fresh EC2 instance whose key has never been seen before, which is the convenience the flag offers. The cost is that a connection to an unintended server also succeeds silently, because the client skips key comparison entirely. No warning about this behaviour appears in the README.
If host key verification matters, the `--ssh` shortcut is the wrong choice. Writing the command manually using the -c flag and omitting the StrictHostKeyChecking option preserves SSH's default behaviour, at the cost of a confirmation prompt for hosts whose keys are not yet stored.
Logging saves each pane's output under ~/.cache/xpanes/logs by default
Passing `--log` enables logging. Without a value, files go to `~/.cache/xpanes/logs`. Providing a directory path redirects them:
$ xpanes --log=~/log --ssh user1@host1 user2@host2 user2@host3Filenames follow the format `[:ARG:].log.%Y-%m-%d_%H-%M-%S` by default. The `[:ARG:]` token carries the argument value for that pane, so each file's name identifies which host or input value produced it. Passing `--log-format=<FORMAT>` changes the naming scheme entirely.
Log files capture raw terminal output, which means ANSI escape codes appear in the file whenever the pane's commands produce them and that complicates any later text processing. The README does not document a flag to strip escape codes at write time, so post-processing with a tool that understands ANSI sequences is the only path to clean text from those files.
Speedy mode removes the interactive shell, and -ss also closes the pane when the process exits
Normal mode opens an interactive shell in each pane, then sends the command to it. Speedy mode, invoked with -s, runs the command directly without that intermediate shell. Startup overhead drops because one layer of shell initialization is skipped.
The -ss flag goes further: it runs in speedy mode and closes each pane automatically when its process finishes. That pairing suits short-lived commands where leaving an idle shell open is unwanted. For monitoring commands that run until stopped manually, -s alone is the right choice, since -ss would close the pane before the output can be read.
Passing `--interval=<seconds>` inserts a delay between each pane creation and each command execution. sleep(1) is the mechanism behind this interval. That detail matters when connecting to systems that throttle rapid incoming connections, since even a brief gap between openings changes the rate of new sessions.
Bash 3.2 and tmux 1.8 are the stated floor, and tmux 1.6 or 1.7 need v2.2.3
Requirements listed in the README are Bash 3.2 or later and tmux 1.8 or later. Bash 3.2 is the version that ships with macOS by default, which makes Homebrew installs straightforward. For tmux 1.6 and 1.7, the README points to v2.2.3 as the compatible version and links to that tree directly. No equivalent exception appears for Bash versions below 3.2.
RHEL and CentOS paths both route through EPEL. RHEL and CentOS 8 and later use dnf with an EPEL RPM as a prerequisite; CentOS 7 uses yum with the same pattern. The last push to the repository was on 2026-05-05, and the latest tagged version is v4.2.0 from 2024-02-05. A CONTRIBUTING.md and an uninstall.sh file exist at the root, so removal is documented, though not described in the main README.
Editorial conclusion
tmux-xpanes suits engineers who repeatedly run the same command against a changing set of hosts or containers and want the output visible side by side. The template flag, pipe mode, and built-in logging cover most fleet-inspection workflows without a wrapper script. Avoid the --ssh shortcut on untrusted networks: it expands to StrictHostKeyChecking=no, and the README does not say how to restore host key verification within the same shorthand. Before using any layout preset, check your tmux version: mhm and mvm require tmux 3.5 or newer, even though the requirements section names only tmux 1.8 as the floor.
Frequently asked questions
What is tmux-xpanes?
tmux-xpanes is a shell script that wraps tmux to split a terminal window into multiple panes and run a templated command in each one. It substitutes {} in the template for each argument and opens one pane per argument. Bash 3.2 and tmux 1.8 are the minimum requirements.
How do I install tmux-xpanes on macOS or Linux?
On macOS, brew install tmux-xpanes handles the install. On Fedora, dnf install xpanes works without adding any repository. Ubuntu users add a PPA first and then run apt install tmux-xpanes. A manual path downloads the single script file and places it in PATH.
Can tmux-xpanes run commands on multiple SSH hosts at once?
Yes. The --ssh flag opens one pane per host. According to the options table, --ssh expands to -t -s -c 'ssh -o StrictHostKeyChecking=no {}', so host key verification is disabled by default when using that shortcut.
Does tmux-xpanes work outside a running tmux session?
The README lists 'runnable from outside of tmux session' alongside 'runnable from inside of tmux session' as explicit features. Both contexts are supported.
How do I log the output of each pane in tmux-xpanes?
Pass --log to enable logging. Without a value, files go to ~/.cache/xpanes/logs. Pass a directory path to redirect them. Filenames default to [:ARG:].log.%Y-%m-%d_%H-%M-%S, where [:ARG:] is the argument value for that pane.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/greymd-tmux-xpanes)Was this useful?