smux is a tmux session manager with fzf-powered session creation and switching.
Install • Quick Start • Common Workflows • Projects vs Templates • Config • Commands
Highlights:
- 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.
Install
With Homebrew:
With Nix:
With Cargo:
The 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.
Quick Start
Create a starter config:
Main 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:
For 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:
Good first commands:
smux 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.
Common Workflows
Jump to an existing session, launch a project, or pick a directory:
Connect a directory and let smux create or reuse the matching tmux session:
Force a specific template for a directory:
Choose a template interactively from the selector:
Export the current tmux session as a project definition:
Saved 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:
= [
{ = "my_window", = "~/Development/project", = [
{ = "nvim -c 'lua require(\"persistence\").load()'" },
] },
]
Preview the generated project without writing a file:
Projects Vs Templates
smux 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.
Picker Behavior
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].
Configuration
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:
[]
= "default"
= "auto"
[]
= 75
= 108
= 179
= 81
[]
= "ctrl-c"
= "ctrl-s"
= "ctrl-f"
= "ctrl-p"
= "ctrl-x"
[]
= "main"
= [{ = "main" }]
[]
= "editor"
= 0
= [
{ = "editor", = "source .venv/bin/activate", = "nvim" },
{ = "run", = true, = "main-horizontal", = [
{ = "cargo run" },
{ = "right 40%", = "cargo test", = true },
] },
]
Example project file:
= "~/code/example"
= "example"
= "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
Commands
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>]
Completions And Man Pages
zsh completions:
man pages:
This includes the config man page:
smux-config.5