tmux Fluency: 30-Day Hands-On Challenge

0/30 days complete 0%

Objective: Understand how tmux sessions persist in the background
tmux new -s mysession
echo This is session 1 ...
# press prefix + d to detach
tmux attach -t mysession
Objective: Manage multiple concurrent sessions
tmux new -s work
 tmux new -s play
 tmux new -s test
tmux ls
tmux kill-session -t test
Objective: Prove session survives terminal disconnect
# detach, close tab, open new tab
tmux ls          # server still running
tmux attach      # session still alive

Objective: Organize workflow with named windows
prefix + c  # new window
prefix + ,  # rename window
# name: code, logs, git, docs, shell
Objective: Build muscle memory for window switching
prefix + n    # next window
prefix + p    # prev window
prefix + 0-9  # jump to window N
prefix + l    # last window
Objective: Run background tasks while working in another window
prefix + c
tail -f /var/log/syslog
# switch away, switch back — still tailing

Objective: Master pane splitting and navigation
prefix + %    # vertical split (left/right)
prefix + "    # horizontal split (top/bottom)
prefix + arrows  # move between panes
Objective: Focus on single pane without losing layout
prefix + z    # zoom into current pane
prefix + z    # unzoom
Objective: Handle mistakes without panic
prefix + x    # close pane
# notice layout shift — learn to live with it

Objective: Design multi-window, multi-pane project layout
# window 1: prefix + % twice, prefix + " once
# window 2: prefix + c
Objective: Rearrange layout on the fly
prefix + !    # break pane into new window
prefix + }    # move pane right
prefix + {    # move pane left
Objective: Internalize full session lifecycle
tmux new -s proj
# build layout, rename, detach, reattach
tmux rename-session -t 0 'myproject'

Objective: Navigate scrollback buffer efficiently
seq 1 1000
prefix + [    # enter copy mode
# arrow keys or PgUp to scroll
Objective: Transfer text between panes via copy buffer
prefix + [
# navigate, Space to start selection
# Enter/y to copy, prefix + ] to paste
Objective: Find specific content in large output
prefix + [
/keyword    # search forward
?keyword    # search backward
n/N         # next/prev match
Objective: Use vim-style navigation in copy mode
prefix + :
set -g mode-keys vi
# now use h/j/k/l in copy mode

Objective: Build complex multi-session environments
tmux new -s a
# add windows + panes, then:
tmux new -s b
tmux new -s c
Objective: Manage sessions without leaving keyboard
prefix + s    # list/switch sessions
prefix + $    # rename session
tmux kill-session -t name
Objective: Achieve session management fluency
# speed drill — muscle memory
# create session → windows → panes → detach

Objective: Build a real-world developer workspace
tmux new -s dojo
# window 1: prefix + % (editor + shell)
# window 2: htop
# window 3: git status
Objective: Fluent session → window → pane → copy → paste flow
session → window → pane → copy → paste
# full cycle 10x
Objective: Instant navigation to any element
prefix + 0-9  # window jump
prefix + arrows # pane jump
# target: < 3s
Objective: Plug knowledge gaps with targeted repetition
prefix + ?    # list all keys
# find your weak spots, drill them

Objective: Understand each config option's effect
# ~/.tmux.conf
set -g prefix C-a
unbind C-b
bind C-a send-prefix
set -g mouse on
# reload: prefix + : source ~/.tmux.conf
Objective: Adapt muscle memory to custom prefix
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# now use C-a instead of C-b

Objective: Know when to use each layout preset
prefix + space    # cycle layouts
even-horizontal, even-vertical, main-horizontal, main-vertical, tiled
Objective: Create editor-focused workspace layout
prefix + space until main-horizontal
# resize: prefix + Alt+arrows
Objective: Design layout matching your actual tools
prefix + z    # zoom pane
prefix + Alt+arrows  # resize split

Objective: Display useful system info in status bar
set -g status-right '#H | #(uptime | cut -d, -f2) | %H:%M'
Objective: Visually distinguish active window
setw -g window-status-current-style bg=green,fg=black
Objective: Personalize status bar for your needs
set -g status-right '#(date "+%%Y-%%m-%%d %%H:%%M")'

Objective: Navigate panes with vim-style keys
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
Objective: Speed up config reload and window access
bind r source-file ~/.tmux.conf \; display 'reloaded'
bind -n M-1 select-window -t 1
Objective: Own your config through memorization
# delete ~/.tmux.conf, rebuild from memory
cat ~/.tmux.conf

Objective: Discover hidden tmux capabilities
tmux list-keys | less
# find commands you never used
Objective: Master advanced pane manipulation
prefix + : resize-pane -L 10
prefix + : join-pane -s 0
prefix + : swap-pane -U
prefix + : setw synchronize-panes on
Objective: Create reusable command shortcuts
# bind them in .tmux.conf:
bind S command-prompt -p 'session:' 'new-session -s "%%"'

Objective: Full mouse integration for convenience
set -g mouse on
# click panes, drag borders, scroll wheel
Objective: Visual organization by color coding
set -g window-status-format '#[fg=colour240]#I:#W'
set -g window-status-current-format '#[fg=colour46,bold]#I:#W'
Objective: Consistent appearance across environments
set -g default-terminal 'tmux-256color'
set -ga terminal-overrides ',xterm-256color:Tc'

Objective: Prove config fluency from memory
mv ~/.tmux.conf ~/.tmux.conf.bak
touch ~/.tmux.conf
# rebuild: prefix, mouse, vim nav, colors, status
Objective: Speed benchmark for config creation
# target: < 20 minutes
# no peeking at notes
Objective: Deep understanding of every setting
# if you can't explain it, you don't own it
# annotate every line in ~/.tmux.conf

Objective: Automate workspace creation via CLI
tmux new -s proj -d
tmux split-window -h -t proj
tmux send-keys -t proj 'vim' Enter
Objective: Script detached session with working directory
tmux new -s proj -d -c ~/project
tmux attach -t proj
Objective: Send commands to specific panes programmatically
tmux send-keys -t proj 'ls -la' Enter

Objective: Create safe, re-runnable session scripts
#!/bin/bash
if tmux has-session -t dev 2>/dev/null; then
  tmux attach -t dev
else
  tmux new -s dev -c ~/project
fi
Objective: Verify script works in all contexts
chmod +x ~/bin/dev
~/bin/dev    # always correct result

Objective: Define sessions as version-controlled YAML
pip install tmuxp
# ~/.tmuxp/project.yaml:
session_name: project
windows:
  - editor:
      layout: main-vertical
      panes:
        - vim
        - shell
  - server: npm start
  - git: git status
Objective: Reproducible session definitions
tmuxp load ~/.tmuxp/project.yaml
tmuxp freeze > ~/.tmuxp/project.yaml
Objective: Capture existing workspace as YAML
tmuxp freeze -y > new_session.yaml

Objective: One-command session access from shell
# ~/.bashrc or ~/.zshrc:
ta() { tmux has-session -t "$1" 2>/dev/null && tmux attach -t "$1" || tmux new -s "$1"; }
Objective: Automatic tmux on remote connections
# ~/.bashrc:
if [ -n "$SSH_CLIENT" ] && [ -z "$TMUX" ]; then
  tmux attach-session -t main || tmux new-session -s main
fi
Objective: Share environment variables across panes
set -g update-environment 'SSH_AUTH_SOCK SSH_CLIENT'
# or: tmux setenv -g VAR value

Objective: Execute same command across multiple panes
prefix + :
setw synchronize-panes on
# type in all panes at once
setw synchronize-panes off
Objective: Toggle sync mode instantly
# bind to key:
bind S setw synchronize-panes \; display 'sync toggled'
Objective: Export terminal output for documentation
tmux capture-pane -t 0 -p > /tmp/output.txt
tmux capture-pane -t 0 -S -1000 | tee output.txt

Objective: Work persists through network drops
ssh remote
tmux new -s work
tail -f /var/log/app.log
# close SSH, reconnect: job still running
Objective: Multi-client session sharing
tmux attach -t session    # terminal 1
tmux attach -d -t session  # terminal 2 takes over
Objective: Simulate remote environment locally
docker run -it --name tmux-test ubuntu bash
apt update && apt install tmux -y

Objective: Build reusable automation toolkit
# dev: new-session + split + send-keys
# monitor: htop, logs, ping in panes
# switcher: tmux switch-client -t name
Objective: Harden scripts against edge cases
# run script twice — must not error
# add has-session checks
Objective: Speed and accuracy in full lifecycle
# speed drill
time ( tmux new -s test -d && sleep 0.1 && tmux kill-session -t test )

Objective: Set up plugin management system
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# ~/.tmux.conf:
set -g @plugin 'tmux-plugins/tpm'
# press prefix + I to install
Objective: Copy text to system clipboard
set -g @plugin 'tmux-plugins/tmux-yank'
# copy mode: y copies to system clipboard
Objective: Open links directly from terminal
set -g @plugin 'tmux-plugins/tmux-open'
# copy mode: O opens URL under cursor

Objective: Survive reboot with full workspace intact
set -g @plugin 'tmux-plugins/tmux-resurrect'
# save: prefix + Ctrl+s
# restore: prefix + Ctrl+r
tmux kill-server
# restart, restore — everything back
Objective: Automatic persistence without manual save
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
set -g @continuum-save-interval '15'

Objective: Seamless navigation between vim and tmux
set -g @plugin 'christoomey/vim-tmux-navigator'
# use C-h/j/k/l to move between vim and tmux panes
Objective: Fuzzy finding for sessions and files
set -g @plugin 'sainnhe/tmux-fzf'
# prefix + Ctrl-f for fuzzy session switch

Objective: Use popup panes for quick tasks
prefix + : display-popup
prefix + : display-popup -E    # interactive
prefix + : display-popup -w 80% -h 80%
Objective: Log terminal output for debugging
tmux pipe-pane -o 'cat >> /tmp/tmux.log'
tmux pipe-pane    # stop logging
Objective: Run isolated tmux server instances
tmux -L foo new -s x    # custom socket
tmux list-sockets

Objective: Design layout matching your development stack
# editor: 75% main + 25% side
# server: logs tailed
# git: status + diff panes
Objective: Complete workflow within tmux only
# every action through tmux
# count how many times you reach for new tab — retrain

Objective: System monitoring dashboard in tmux
tmux new -s monitor
tmux split-window -h
tmux split-window -v
tmux select-pane -t 0
# htop | journalctl -f | df -h | ping localhost
Objective: Manage multiple servers simultaneously
# one tmux window per host
# synchronize-panes for parallel commands

Objective: Navigate nested tmux sessions
set -g prefix2 C-a    # secondary prefix
# double-tap prefix to reach inner tmux
Objective: Share windows across multiple sessions
tmux new-session -d -s base
tmux new-session -d -s child -t base
# windows shared across group

Objective: Optimize config for performance and clarity
# comment every line: why, not what
# remove anything you don't use daily
Objective: Cross-environment consistency
# kitty, xterm, alacritty — all should look same
# SSH in, verify colors and keys
Objective: Continuous learning from documentation
man tmux | less
# search for commands you use daily — find hidden flags

Objective: Clean installation from zero
apt install tmux / brew install tmux
tmux -V
Objective: Full config from memory under time pressure
# prefix, vim nav, mouse, colors, status, reload, base-index 1
Objective: Automated workspace in under 10 minutes
tmux new -s dev -d
tmux split-window -h -t dev
tmux split-window -v -t dev.0
tmux send-keys -t dev 'vim' Enter
Objective: Full plugin ecosystem operational
# plugins installed, save/restore working, auto-save on
Objective: Complete copy workflow mastery
prefix + [ → /search → Space → y → prefix + ]
Objective: Operations dashboard from scratch
htop | journalctl -f | df -h | ping localhost
Objective: Full disaster recovery in 5 minutes
prefix + Ctrl+s
tmux kill-server
# restart, prefix + Ctrl+r
Objective: Troubleshoot without config reload
prefix + :
# fix via command mode, no config reload
list-keys, show-options, resize-pane