Created
August 5, 2022 19:08
-
-
Save wegotoeleven/fd33402e71b83d7e13690ef33717c376 to your computer and use it in GitHub Desktop.
Tmux screen sharing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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