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:

  1. Create a named session in terminal 1

  2. Attach to same session in terminal 2

  3. Observe that both see the same thing

  4. One user types, other sees immediately

# Terminal 1:


# Terminal 2:

Exercise 5.2: Grouped Sessions

  1. Create main session

  2. Create grouped session from another terminal

  3. Switch windows independently

  4. Observe shared windows but independent views

# Commands:

Exercise 5.3: SSH Pairing Setup

Document how you would set up remote pairing:

# Setup steps:

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: _