Permalink
Browse files

Add ability to host/join foreign tmux sessions.

Created aliases to ease the creation and joining of multi-user tmux sessions.
tmux-host     : Create tmux session for other users to join.
tmux-kill-host: Kill tmux-server and remove /tmp/tmux_host session file.
tmux-mirror   : Attach to Host in read-only mode.
tmux-pair     : Create attachment to Host which allows editing.
tmux-attach   : Reattach to Pair Mode session (can only be run after tmux-pair).
All joining commands should notify the tmux session
  • Loading branch information...
1 parent a1e623b commit e3f5b7b8bded174454a0d347836a6c40e8e4c99a @zolrath committed Mar 6, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 tmux_host
View
@@ -0,0 +1,16 @@
+# # To only allow client to mirror and disconnect them if they detach:
+# exec tmux -S /tmp/tmux_host display-message "$USERNAME has connected in mirror mode." && tmux -S /tmp/tmux_host a -t Host -r
+
+alias tmux-host='tmux -S /tmp/tmux_host new-session -s Host -d && chmod 1777 /tmp/tmux_host && tmux-attach'
+alias tmux-kill-host='tmux -S /tmp/tmux_host kill-server; rm /tmp/tmux_host'
+alias tmux-mirror='tmux -S /tmp/tmux_host display-message "$USERNAME has connected in mirror mode." && tmux -S /tmp/tmux_host a -t Host -r'
+alias tmux-pair='tmux -S /tmp/tmux_host display-message "$USERNAME has connected in pair mode." && tmux -S /tmp/tmux_host new-session -t Host -s Client'
+alias tmux-attach='tmux -S /tmp/tmux_host display-message "$USERNAME has reattached to pair mode." && tmux -S /tmp/tmux_host a'
+
+# echo "To connect to tmux please use one of the following:"
+# echo "tmux-mirror: Attach to Host in read-only mode"
+# echo "tmux-pair : Create attachment to Host which allows editing"
+# echo "tmux-attach: Reattach to Pair Mode session (can only be run after tmux-pair)"
+
+# # To start client in mirror mode but allow them to detach:
+# tmux-mirror

0 comments on commit e3f5b7b

Please sign in to comment.