λDennis-Tanui-V0.0.80[0:HOME]1[1:POSTS]2[2:PROJECTS]3[3:ABOUT]
➜~/blogs/building-tmux-workflow

Building a tmux workflow for remote development

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

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:

  1. Editor — nvim in the left pane, file tree in the right
  2. Server — dev server with logs streaming
  3. 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.