aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2025-01-05 19:07:34 -0300
committerSilvio Rhatto <rhatto@riseup.net>2025-01-05 19:07:34 -0300
commit1e56208aebdb4dc81ab16042208861901490bd5b (patch)
tree1a5ede76dc40b28068d7545f1a61cf5f64029c0c
parent5133cabd9e7765953761dd9b1a1529f09b5133e8 (diff)
downloadtermplex-master.tar.gz
termplex-master.tar.bz2
Fix: shell: use the separate socket version for remote sessionsHEADmaster
-rwxr-xr-xshell19
1 files changed, 10 insertions, 9 deletions
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