aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-08-02 15:27:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-08-02 15:27:29 -0300
commit5585ddfc0b7098900a916cf581736f3601d4c7db (patch)
treeaf1222ea201aa5c4e6eb497c9899b715bc36a9d5 /shell
parent6ced9f8d7442563a48cb06a96e374030f363a328 (diff)
downloadtermplex-5585ddfc0b7098900a916cf581736f3601d4c7db.tar.gz
termplex-5585ddfc0b7098900a916cf581736f3601d4c7db.tar.bz2
Feat: support for starting detached tmux sessions
Diffstat (limited to 'shell')
-rwxr-xr-xshell11
1 files changed, 7 insertions, 4 deletions
diff --git a/shell b/shell
index 0dd64e6..df569e9 100755
--- a/shell
+++ b/shell
@@ -59,6 +59,9 @@ fi
# Set default screen title
window_title $DEST
+# Shift args
+shift 2
+
# Dispatcher
if [ "$BASENAME" == "shells" ]; then
# Remote screen shell using $AUTOSSH
@@ -66,7 +69,7 @@ if [ "$BASENAME" == "shells" ]; then
SUDO="sudo"
$AUTOSSH $DEST -t -- "`shell_remote_multiplexer`"
else
- $AUTOSSH $DEST -t -- "`shell_remote_multiplexer` $COMMAND"
+ $AUTOSSH $DEST -t -- "`shell_remote_multiplexer` $COMMAND $*"
fi
else
if [ -z "$COMMAND" ] && shell_${LOCAL_MULTIPLEXER}_ls $DEST; then
@@ -80,14 +83,14 @@ else
elif [ -z "$COMMAND" ] && ( [ -f "$HOME/.screen/$DEST" ] || [ -f "$HOME/.tmux/$DEST" ] ); then
# Local root shell
window_title $DEST
- shell local $DEST
+ shell local $DEST $*
elif [ "$DEST" == "local" ]; then
# Local screen shell
window_title $COMMAND
- $LOCAL_MULTIPLEXER $COMMAND
+ $LOCAL_MULTIPLEXER $COMMAND $*
else
# Remote shell using $AUTOSSH
- $AUTOSSH $DEST -t -- $COMMAND
+ $AUTOSSH $DEST -t -- $COMMAND $*
fi
fi