Stew's Blog

home resume github

Pair Program with tmux

04 Dec 2013

Pair programming should not involve two people hunched over one screen. Using ssh and tmux, both people can share the same screen on seperate computers and see live updates.

Ed and Ian want to pair program.

  1. Ed ssh's into a machine
  2. Ed creates a user for Ian
            ed@machine:~$ adduser ian
        
  3. Ed starts a tmux session
            ed@machine:~$ tmux
        
  4. Ian ssh's into the machine
  5. Ian changes users to become Ed
            ian@machine:~$ su ed
        
  6. Ian attaches to ed's tmux session (note Ian's prompt will display 'ed')
            ed@machine:~$ tmux attach
        

Now Ian and Ed share a screen and can see what the other is typing and make changes. BAM.

Thanks to Ed Zane for showing me this.