A command-line tool for controlling tmux.
Quick Install:
The script needs only curl (or wget), and uses the GitHub CLI (gh) instead when it's installed:
curl -fsSL https://raw.githubusercontent.com/MunifTanjim/tmux-ctrl/main/scripts/install.sh | bashThis will install to ~/.local/bin/tmux-ctrl.
To install to a custom directory:
curl -fsSL https://raw.githubusercontent.com/MunifTanjim/tmux-ctrl/main/scripts/install.sh | INSTALL_DIR=$HOME/.local/bin bashManual Installation (from source):
Requires Go 1.26+.
-
Clone the repository:
git clone https://github.com/MunifTanjim/tmux-ctrl.git cd tmux-ctrl -
Install the CLI:
make install
This will build the binary and install it to
~/.local/bin/tmux-ctrl.
tmux-ctrl completion install
# or
tmux-ctrl completion zsh > "${fpath[1]}/_tmux-ctrl"Install with TPM — add to ~/.tmux.conf:
set -g @plugin 'MunifTanjim/tmux-ctrl'If tmux-ctrl isn't on your PATH, the plugin downloads the latest release to
~/.local/bin in the background (needs curl, wget, or gh) and binds keys
to that path. Skipped when @ctrl_command is set. On failure, keys do nothing —
check ${TMPDIR:-/tmp}/tmux-ctrl-install.log.
All options are optional; their defaults are shown below. Override any of them
before the @plugin line.
| Option | Default | Description |
|---|---|---|
@ctrl_command |
tmux-ctrl |
The tmux-ctrl binary to invoke. |
@ctrl_default_keybindings |
on |
Set to off to disable all default bindings. |
@ctrl_session_prev_key |
( |
prefix + ( — go to the previous session. |
@ctrl_session_next_key |
) |
prefix + ) — go to the next session. |
@ctrl_pane_move_key |
M |
prefix + M — move the current pane. |
@ctrl_pane_extract_key |
Space |
prefix + Space — extract tokens from the pane via an overlay. |
@ctrl_pane_extract_command |
tmux load-buffer - |
Command the extracted token is piped into. |
Set any key option to an empty string to disable that single binding:
set -g @ctrl_pane_move_key ''Example:
set -g @ctrl_command 'tmux-ctrl'
set -g @ctrl_session_prev_key 'P'
set -g @ctrl_session_next_key 'N'
set -g @plugin 'MunifTanjim/tmux-ctrl'Licensed under the MIT License. Check the LICENSE file for details.