Sharing a tmux Session

To pair-program with tmux, we must connect a second client to our session. Leave the tmux session we created earlier running. Then open a second terminal window (outside of tmux) and run this command:

 
$ ​tmux attach

The second terminal will look identical to the first terminal. That’s because it’s the same tmux session. Start typing in the first terminal, and we’ll see the changes in the second terminal. Likewise, characters entered in the second terminal will appear in the first terminal. If we run a command like ping, it will be visible in both consoles. We’re only simulating the process of pair programming with tmux in this example. In the real world, the two terminal windows would exist on separate machines, but ...

Get Remote Pairing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.