aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rwxr-xr-xshell15
1 files changed, 12 insertions, 3 deletions
diff --git a/shell b/shell
index 84e95d7..d6a291d 100755
--- a/shell
+++ b/shell
@@ -42,10 +42,19 @@ function shell_wtmux_ls {
# Try tmux, then screen
function shell_remote_multiplexer {
+ # Default tmux command
tmux="tmux attach"
+ # 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 -t $1"
+ tmux="tmux -L${1} attach -t $1"
fi
echo "$SUDO $tmux || $SUDO screen -x $1"
@@ -71,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