Tmux is a terminal multiplexer that helps us split our terminal into multiple panes and run sessions
We can watch logs in one pane, run kubectl in the other, and never lose our work if the connection drops, using control+b.
Aliases (add to ~/.bashrc or ~/.zshrc)
alias tmux-s='tmux new-session -A -s t0'
alias tmux-v='tmux new-session -A -s t0 ; split-window -v 2>/dev/null || tmux split-window -v'
alias tmux-h='tmux new-session -A -s t0 ; split-window -h 2>/dev/null || tmux split-window -h'
alias tmux-d='tmux detach'
alias tmux-k='tmux kill-session -t t0'After adding, reload your shell:
source ~/.bashrc # or source ~/.zshrcUsage
List sessions by running tmux ls or tmux list
| Alias | What it does |
|---|---|
tmux-s | Start a plain session (or reattach if already running) |
tmux-v | Start with vertical split — panes top and bottom |
tmux-h | Start with horizontal split — panes side by side |
tmux-d | Detach — session keeps running in background |
tmux-k | Kill the session entirely |
Keybindings (inside tmux)
All keybindings start with the prefix key: Ctrl+b
| Keys | What it does |
|---|---|
Ctrl+b ← | Move to left pane |
Ctrl+b → | Move to right pane |
Ctrl+b ↑ | Move to upper pane |
Ctrl+b ↓ | Move to lower pane |
Ctrl+b z | Zoom pane fullscreen (toggle) |
Ctrl+b d | Detach (same as tmux-d) |
Typical Workflow
tmux-h # start session with two panes side by side
# left pane: watch logs
# right pane: run kubectl commands
Ctrl+b ←→ # switch between panes
tmux-d # detach when done — session keeps running
tmux-s # reattach later from any terminal
tmux-k # kill session
List sessions by running tmux ls or tmux list

Ctrl+b →Move to the right pane & Ctrl+b ←Move to the left pane

tmux-kKill the session entirely

tmux has exited

(Visited 7 times, 1 visits today)

