Skip to content

Instantly share code, notes, and snippets.

@wegotoeleven
Created August 5, 2022 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wegotoeleven/fd33402e71b83d7e13690ef33717c376 to your computer and use it in GitHub Desktop.
Save wegotoeleven/fd33402e71b83d7e13690ef33717c376 to your computer and use it in GitHub Desktop.
Tmux screen sharing
read -p "Session name: " nameOfSession
# Create socket
touch /tmp/${nameOfSession} && chgrp serveradmins /tmp/${nameOfSession}
# Create session
tmux -CC -S /tmp/${nameOfSession} new -s ${nameOfSession}
# Connect to the session from the second terminal
tmux -S /tmp/${nameOfSession} attach -t ${nameOfSession}
# To make the session read only for 2nd user
tmux -S /tmp/${nameOfSession} attach -t ${nameOfSession} -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment