tmux Cheatsheet (WSL)
Section titled “tmux Cheatsheet (WSL)”Custom Prefix: Ctrl + Space
Config file: ~/.config/tmux/tmux.conf
Quick Start
Section titled “Quick Start”tmux # Start new sessiontmux new -s name # Named sessiontmux attach -t name # Attachtmux ls # List sessionstmux kill-session -t nameCore Shortcuts
Section titled “Core Shortcuts”| Action | Shortcut | Notes |
|---|---|---|
| New window (tab) | Prefix + c | |
| Next window | Prefix + n | |
| Previous window | Prefix + p | |
| Switch window | Prefix + 0-9 | |
| Rename window | Prefix + , | |
| Kill window | Prefix + & | Confirm y |
| Split vertical | Prefix + % | |
| Split horizontal | Prefix + “ | |
| Switch panes | Prefix + Arrow | |
| Zoom pane | Prefix + z | Toggle |
| Kill pane | Prefix + x | Confirm y |
| Detach session | Prefix + d | |
| Reload config | Prefix + r |
Working Directory & Duplication
Section titled “Working Directory & Duplication”| Action | Command / Shortcut |
|---|---|
| New window in current folder | Prefix + c (with config) |
| Duplicate current tab (same folder) | Prefix + C (recommended binding) |
| One-time duplicate | Prefix + : → new-window -c ”#{pane_current_path}“ |
| New session in specific folder | tmux new -s name -c /path/to/folder |
| Split keeping current folder | Prefix + | or Prefix + - (with config) |
Recommended tmux.conf (add to ~/.config/tmux/tmux.conf)
Section titled “Recommended tmux.conf (add to ~/.config/tmux/tmux.conf)”set -g prefix C-Spaceunbind C-bbind C-Space send-prefix
set -g mouse onset -g base-index 1setw -g pane-base-index 1set -g renumber-windows onset -s escape-time 0set -g history-limit 50000
# Smart directory behaviorbind c new-window -c "#{pane_current_path}"bind C new-window -c "#{pane_current_path}" # Duplicate current windowbind | split-window -h -c "#{pane_current_path}"bind - split-window -v -c "#{pane_current_path}"
# Reload configbind r source-file ~/.config/tmux/tmux.conf \; display "Config reloaded!"Aliases (add to ~/.bashrc or ~/.zshrc)
Section titled “Aliases (add to ~/.bashrc or ~/.zshrc)”Bash
alias tmux="tmux -f ~/.config/tmux/tmux.conf"Tip: After editing config, reload with Prefix + r or restart tmux.