Building a tmux workflow for remote development
·
#tmux#devops#terminal

Why tmux
Remote development means losing context every time you disconnect. tmux gives you persistent sessions that survive network drops and laptop sleeps.
The layout
My standard session starts with three windows:
- Editor — nvim in the left pane, file tree in the right
- Server — dev server with logs streaming
- Git — git status + a scratch shell
bash
# ~/.tmux-session.sh
tmux new-session -d -s dev
tmux send-keys -t dev:1 'nvim .' C-m
tmux new-window -t dev:2 -n server
tmux send-keys -t dev:2 'npm run dev' C-m
tmux new-window -t dev:3 -n git
Session restore with tmux-resurrect
The tmux-resurrect plugin saves pane contents and layout to disk. After a reboot:
Prefix + Ctrl-s — save
Prefix + Ctrl-r — restore
Battery-aware status
Add CPU and battery to the status bar so you know when to unplug:
bash
set -g status-right '#{battery_percentage} | %H:%M'
tmux turns a remote terminal into a persistent development environment.