]> gitweb.fluxo.info Git - termplex.git/commitdiff
Fix: positional argument handling
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Aug 2024 18:57:37 +0000 (15:57 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Aug 2024 18:57:37 +0000 (15:57 -0300)
shell
wtmux

diff --git a/shell b/shell
index df569e91ecdf1ad90c0bb750f101ace5c245be85..84e95d71d60bde3578cdc60e08543dba4204fd4c 100755 (executable)
--- a/shell
+++ b/shell
@@ -60,7 +60,11 @@ fi
 window_title $DEST
 
 # Shift args
-shift 2
+if [ -z "$COMMAND" ]; then
+  shift
+else
+  shift 2
+fi
 
 # Dispatcher
 if [ "$BASENAME" == "shells" ]; then
diff --git a/wtmux b/wtmux
index aa48386dd3da8faa17a5908e9a5de1acc46ff692..b577fd89775feb010671d207716effea20f77945 100755 (executable)
--- a/wtmux
+++ b/wtmux
@@ -43,7 +43,7 @@ if [ ! -z "${name}" ]; then
     fi
   fi
 
-  if [ -z "$state" ] || [ "$state" == "attached" ]; then
+  if [ "$state" != "detached" ]; then
     tmux attach -t ${name}
   fi
 else