Remote Pair Programming With Tmux in the Cloud


I like to pair program with my fellow engineers from time to time when I’m stuck on a problem or want to ensure reviews for complex code changes don’t take a long time. Remote pair programming isn’t as high bandwidth as sitting next to each other, but the experience can be improved with the help of a telephony tool and a shared tmux session in a cloud VM.

For telephony pick something like Skype, Google hangout, or just old-fashioned cell phones. Have a cloud VM both people can SSH into and have one person start the session with $ tmux -S /tmp/tmux-session new -s mysession. The -S flag specifies an alternate tmux server socket. Then chmod 777 /tmp/tmux-session to allow others to connect to your session with tmux -S /tmp/tmux-session attach -t mysession.

I’ve found tmux cloud pair programming is very effective in collaborating remotely. These tools do require both people to be comfortable with the command line and a CLI text-editor. You could use the screen sharing function in Skype or just point a camera at the screen like this guy. But being in the same machine ensures there are no environmental differences. We’ve all had headaches with “Well, it works in my machine.”

No more long roundtrip times between code reviews with someone in another timezone. No more frustration at having miscommunicated in gerrit comments. Just you, the other engineer, and the code itself. Feel free to share your favorite remote collaboration tools or ways to improve this process in the comments below.