]> gitweb.fluxo.info Git - termplex.git/commitdiff
Fix: shell: use the separate socket version for remote sessions master
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 5 Jan 2025 22:07:34 +0000 (19:07 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 5 Jan 2025 22:07:34 +0000 (19:07 -0300)
shell

diff --git a/shell b/shell
index 626e42f1b63ff7c0dc4b9e0234d7291f38267392..d6a291dd3af2a68ef04fa7b9ea55ebab04847652 100755 (executable)
--- a/shell
+++ b/shell
@@ -45,16 +45,17 @@ function shell_remote_multiplexer {
   # Default tmux command
   tmux="tmux attach"
 
-  # Common socket version
-  if [ ! -z "$1" ]; then
-    tmux="tmux attach -t $1"
-  fi
+  # Version with a common socket
+  #if [ ! -z "$1" ]; then
+  #  tmux="tmux attach -t $1"
+  #fi
 
+  # Version with a separate socket
   # Ensure there's a separate server running for each session.
   # Check wscreen for details
-  #if [ ! -z "$1" ]; then
-  #  tmux="tmux attach -L${1} -t $1"
-  #fi
+  if [ ! -z "$1" ]; then
+    tmux="tmux -L${1} attach -t $1"
+  fi
 
   echo "$SUDO $tmux || $SUDO screen -x $1"
 }
@@ -79,9 +80,9 @@ if [ "$BASENAME" == "shells" ]; then
   # Remote screen shell using $AUTOSSH
   if [ "$COMMAND" == "root" ]; then
     SUDO="sudo"
-    $AUTOSSH $DEST -t -- "`shell_remote_multiplexer`"
+    $AUTOSSH $DEST -t -- "`shell_remote_multiplexer $COMMAND`"
   else
-    $AUTOSSH $DEST -t -- "`shell_remote_multiplexer` $COMMAND $*"
+    $AUTOSSH $DEST -t -- "`shell_remote_multiplexer $COMMAND` $COMMAND $*"
   fi
 else
   if [ -z "$COMMAND" ] && shell_${LOCAL_MULTIPLEXER}_ls $DEST; then