Skip to content

tmux

tmux is a terminal multiplexer for managing persistent sessions, split panes, and multiple windows inside a single terminal. In this setup it is the layer that keeps shell work organized and quick to return to.

Official Resources

ResourceURL
GitHubgithub.com/tmux/tmux
Wikigithub.com/tmux/tmux/wiki

What It Is Used For Here

UseNotes
SessionsKeep work running after closing a terminal.
PanesSplit the terminal for focused multitasking.
WindowsSeparate related tasks in one tmux session.
NavigationCtrl+a prefix keeps the workflow consistent on macOS.

Key Bindings

ShortcutAction
Ctrl+a then cNew window
Ctrl+a then -Split pane horizontally
Ctrl+a then ``
Ctrl+a then xKill current pane
Ctrl+a then &Kill current window
Ctrl+a then rReload configuration
Ctrl+a then nNext window
Ctrl+a then pPrevious window
Alt + ArrowMove between panes
Alt + H/J/K/LResize panes

Layout Commands

CommandLayout
tmux-devOpens or attaches to a dev session with 2 panes side by side.
tmux-agentOpens or attaches to an agent session with 4 panes in a tiled layout.

Both commands start in the current directory. You can pass a custom session name as the first argument:

sh
tmux-dev project-api
tmux-agent content-workflow

Session Commands

CommandAction
tmuxStart a new tmux session.
tmux lsList running tmux sessions.
tmux attachAttach to the latest tmux session.
tmux attach -t <name>Attach to a specific session.
tmux new -s <name>Start a new named session.
tmux kill-sessionClose the current tmux session and all its windows and panes.
tmux kill-session -t <name>Close a specific tmux session.
tmux kill-serverClose every tmux session.

Exiting And Closing

CommandAction
Ctrl+a then dDetach from tmux without closing the session.
exitClose the current shell, pane, or window when it is the last pane.
Ctrl+dSame as exit in most shells.
Ctrl+a then xClose the current pane.
Ctrl+a then &Close the current window.
tmux kill-sessionClose all panes and windows in the current session.
tmux kill-serverClose all tmux sessions.

Notes

The config lives in tmux/.tmux.conf. Layout commands live in tmux/.local/bin/.