smux is a tmux session manager with fzf-powered session creation and switching.
Install • Quick Start • Common Workflows • Projects vs Templates • Config • Commands
- quickly switch between existing tmux sessions
- tmux session from directory - pick a recent directory and create or reuse a tmux session for it
- tmux session from project - launch a saved project with a defined properties (path, name, windows, panes, layout, commands...)
- apply reusable tmux templates with windows, panes, layouts, and startup commands
It works both inside and outside tmux. Inside tmux, it fits naturally in a popup. Outside tmux, it uses the current terminal.
With Homebrew:
brew install Aietes/homebrew-smux/smuxWith Nix:
nix profile install nixpkgs#smuxWith Cargo:
cargo install smux-cliThe published crates.io package is smux-cli, but the installed command is still smux.
Runtime dependencies:
- required:
tmux,fzf - optional but recommended:
zoxide
If zoxide is unavailable, smux select still works with tmux sessions and saved projects.
Create a starter config:
smux initMain config path, following the default XDG config location:
~/.config/smux/config.toml
Project definitions live alongside it:
~/.config/smux/projects/*.toml
smux init writes starter files with version-matched schema directives for editors that support TOML JSON Schema integration.
Then start using it:
smux selectFor normal day-to-day use, wire it into tmux:
Recommended tmux settings:
set -g detach-on-destroy off # keeps tmux running when you close a session
bind-key t display-popup -w 70% -h 70% -E "smux select"
bind-key T display-popup -w 70% -h 70% -E "smux select --choose-template"To launch it in zsh outside of tmux with Ctrl-t:
smux-select-widget() {
zle push-line
BUFFER="smux select"
zle accept-line
}
zle -N smux-select-widget
bindkey -M emacs '^T' smux-select-widget
bindkey -M viins '^T' smux-select-widgetGood first commands:
smux doctor
smux select
smux save-project myapp --stdoutsmux select is the main entrypoint. It opens a picker that can:
- switch to an existing tmux session
- launch a saved project
- create or reuse a session from a recent directory
Use smux select --choose-template when you want directory selection to be followed by an explicit template picker.
It can run inside tmux (recommended as popup), or outside tmux in the terminal.
Jump to an existing session, launch a project, or pick a directory:
smux selectConnect a directory and let smux create or reuse the matching tmux session:
smux connect ~/code/myappForce a specific template for a directory:
smux connect --template rust ~/code/myappChoose a template interactively from the selector:
smux select --choose-templateExport the current tmux session as a project definition:
smux save-project myappSaved projects are stored in .config/smux/projects/, and can be edited and adjusted. As an example the pane command can launch Neovim and restore the last persistence.nvim session:
windows = [
{ name = "my_window", cwd = "~/Development/project", panes = [
{ command = "nvim -c 'lua require(\"persistence\").load()'" },
] },
]Preview the generated project without writing a file:
smux save-project myapp --stdoutsmux separates reusable layout from concrete workspace definitions:
template: a reusable tmux layout with windows, panes, layouts, startup behavior, and default commandsproject: a concrete named workspace with a known path, optional session name, and either a template reference or its own tmux definition
Use templates when you want to reuse the same shape across many folders. Use projects when you want one named workspace that already knows where it lives and how it should start.
The unified picker combines:
- tmux sessions
- saved projects
zoxidedirectories
The template picker is separate and appears only when --choose-template is used.
Current behavior:
- prompt is shown at the top
Esccancels cleanly- the current tmux session is highlighted when
smux selectruns inside tmux - typing still does normal fuzzy search
Ctrl-Cresets to the full listCtrl-Slimits the main picker to sessionsCtrl-Plimits the main picker to projectsCtrl-Flimits the main picker to foldersCtrl-Xcloses the selected non-current tmux session and keeps the picker open
If you use a Nerd Font, smux can show colored icons for sessions, projects, folders, and templates.
These picker keybinds can be changed in [settings.picker.bindings].
The main config has two top-level sections:
settingstemplates
Project files in projects/*.toml define concrete workspaces.
smux save-project writes project files into that same directory and captures:
pathsession_namestartup_windowstartup_pane- windows and pane
cwd - best-effort pane split direction
It intentionally does not try to export shell history or reconstruct original pane commands.
Schema files are published in this repo under schemas/:
schemas/smux-config.schema.jsonschemas/smux-project.schema.json
Starter files generated by smux init include #:schema directives pointing at the matching versioned schema URLs.
Template resolution order:
--template- matching project definition
settings.default_template- built-in fallback template
Session name resolution order:
--session-name- matching project session name
- sanitized directory basename
Example main config:
[settings]
default_template = "default"
icons = "auto"
[settings.icon_colors]
session = 75
directory = 108
template = 179
project = 81
[settings.picker.bindings]
reset = "ctrl-c"
sessions = "ctrl-s"
folders = "ctrl-f"
projects = "ctrl-p"
delete_session = "ctrl-x"
[templates.default]
startup_window = "main"
windows = [{ name = "main" }]
[templates.rust]
startup_window = "editor"
startup_pane = 0
windows = [
{ name = "editor", pre_command = "source .venv/bin/activate", command = "nvim" },
{ name = "run", synchronize = true, layout = "main-horizontal", panes = [
{ command = "cargo run" },
{ layout = "right 40%", command = "cargo test", zoom = true },
] },
]Example project file:
path = "~/code/example"
session_name = "example"
template = "rust"If you use folke/persistence.nvim, this is a practical editor window command:
{ name = "editor", command = "nvim -c 'lua require(\"persistence\").load({ last = true })'" }Save that as:
~/.config/smux/projects/example.toml
For the full config reference, see:
- docs/configuration.md
smux-config(5)in generated man pages
That reference also includes layout recipes such as:
- 2x2 grid windows
- one large top pane with two bottom panes
- sidebar layouts
- vertical pane stacks
smux select [--choose-template] [--no-project-detect] [--config <path>]
smux connect [--template <name>] [--session-name <name>] [--config <path>] <path>
smux switch <session>
smux list-sessions
smux list-templates [--config <path>]
smux list-projects [--config <path>]
smux doctor [--config <path>]
smux save-project <name> [--session <name>] [--path <path>] [--stdout] [--force] [--config <path>]
smux init [--config <path>]
smux completions zsh [--dir <path>]
smux man [--dir <path>]
zsh completions:
smux completions zsh
smux completions zsh --dir ~/.local/share/zsh/site-functionsman pages:
smux man
smux man --dir ~/.local/share/man/man1This includes the config man page:
smux-config.5