tmuxss is a lightweight session manager for tmux that enables multiview workflows using reusable JSON templates and structured session creation.
- Attach multiple clients to the same
tmuxsession independently - Use reusable JSON templates to define complex environments
- Configure split layouts, commands, working directories, read-only panes, and shell histories
tmuxss can be used directly from the CLI or more conveniently via hotkeys configured in your tmux.conf.
Run this as your terminal startup command:
tmuxss -iThis creates and attaches you to a new session tied to the current terminal client, grouped under the default "main" group.
When run from within an existing tmux session, tmuxss opens an interactive selector. Choosing a session will attach you to it:
tmuxssYou can also attach directly:
tmuxss -a -g <GROUP>-
Kill selected session via prompt:
tmuxss -k
-
Kill specific group session:
tmuxss -k -g <GROUP>
Use the -c option:
tmuxss -c [OPTIONS]| Option | Description |
|---|---|
-g <GROUP> |
(Optional) Group name. Defaults to the basename of the current directory, unless overridden by a template. |
-d |
Start the session without attaching. |
-t <TEMPLATE> |
Load a template by name. Will look for /home/<user>/tmuxss.json. |
-p <PATH> |
Path to a template configuration file (overrides default path). |
Note: The
-s <SESSION ID>option is intended for internal use (e.g., binding sessions to TTYs liketty1). You typically won’t need to use this manually.
Templates define session structure, window layouts, working directories, and commands.
{
"default": "default",
"envs": {
"default": {
"path": ".",
"focused": 0,
"windows": [
{ "name": "code", "command_run": "nvim" },
{ "name": "util", "command_run": "htop" }
]
}
}
}{
"envs": {
"dev": {
"path": "~/src/project",
"windows": [
{
"name": "runtime",
"hsplit": [
{
"vsplit": [
{ "command_prepare": "yarn start", "path": "./frontend" },
{ "command_prepare": "cargo run", "path": "./backend" }
]
},
{ "command_run": "htop" }
]
}
]
}
}
}See example.tmuxss.json for a complete config.
Make the script executable and move it to your PATH:
chmod +x tmuxss
mv tmuxss ~/.local/bin/Add this to your shell config or terminal launcher to bind tmuxss to a specific TTY:
case "$(tty)" in
*/tty4)
tmuxss -i -s $(basename "$(tty)")
exit
;;
esac