Skip to content

Instantly share code, notes, and snippets.

@developer-guy
Forked from shrayasr/pair-program-tmux.md
Created October 15, 2020 10:09
Show Gist options
  • Save developer-guy/8e3d20614edafa730ea58e84928ac7a3 to your computer and use it in GitHub Desktop.
Save developer-guy/8e3d20614edafa730ea58e84928ac7a3 to your computer and use it in GitHub Desktop.
Pair programming with Tmux

Pair programming with Tmux

Using the same user

User 1

  1. SSH into the box

     user1@user1-machine$ ssh user@host
    
  2. Start a tmux session with a name

     user@remote-machine$ tmux new -s <session_name>
    

User 2

  1. SSH into the box

     user2@user2-machine$ ssh user@host
    
  2. Join the session created by User 1

     user@remote-machine$ tmux a -t <session_name>
    

Using different users

User 1

  1. SSH into box

     user1@user1-machine$ ssh user1@host
    
  2. Create a tmux session as a file and set its permissions

     user1@remote-machine$ tmux -S /tmp/pair -d -s pair
     user1@remote-machine$ chmod 777 /tmp/pair
    
  3. Join session

     user1@remote-machine$ tmux -S /tmp/pair attach
    

User 2

  1. SSH into box

     user2@user2-machine$ ssh user2@host
    
  2. Join session created by User 1

     user2@remote-machine$ tmux -S /tmp/pair attach
    

Credits to Flaviu Simihaian and Chris Hunt from where these are taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment