Chapter 5: Pair Programming with tmux
Chapter Overview
Topics covered:
-
Sharing sessions on the same machine
-
Remote pairing with SSH
-
Using grouped sessions
-
Security considerations
Key Concepts
Session Sharing Methods
| Method | Use Case | Complexity |
|---|---|---|
Same session |
Both users see exact same view |
Simple |
Grouped sessions |
Independent windows, shared session |
Medium |
SSH + tmux |
Remote pairing |
More setup |
Socket-Based Sharing
# Create session with specific socket
tmux -S /tmp/pair new-session -s shared
# Another user attaches
tmux -S /tmp/pair attach -t shared
# Set permissions
chmod 777 /tmp/pair
Grouped Sessions
# User 1 creates session
tmux new-session -s main
# User 2 creates grouped session
tmux new-session -t main -s user2
Exercises
Exercise 5.1: Same-Session Sharing
Test with two terminal windows:
-
Create a named session in terminal 1
-
Attach to same session in terminal 2
-
Observe that both see the same thing
-
One user types, other sees immediately
# Terminal 1:
# Terminal 2:
Exercise 5.2: Grouped Sessions
-
Create main session
-
Create grouped session from another terminal
-
Switch windows independently
-
Observe shared windows but independent views
# Commands:
Notes
Write your observations, insights, and questions here as you read.
Relevance to Your Workflow
| Scenario | How tmux pairing helps |
|---|---|
TAC cases |
Share terminal with vendor support |
Teaching |
Show commands to Gabriel or colleagues |
Remote debugging |
Pair with team on infrastructure issues |
Config Ideas
Settings for pairing scenarios:
# Ideas for quantum config
Chapter Completed
-
Read chapter
-
Tested session sharing
-
Documented pairing setup
-
Considered use cases
Date completed: _