From 1e56208aebdb4dc81ab16042208861901490bd5b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 5 Jan 2025 19:07:34 -0300 Subject: Fix: shell: use the separate socket version for remote sessions --- shell | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'shell') diff --git a/shell b/shell index 626e42f..d6a291d 100755 --- 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 -- cgit v1.2.3