summaryrefslogtreecommitdiff
path: root/scripts/tmux-popup-new
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tmux-popup-new')
-rwxr-xr-xscripts/tmux-popup-new16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/tmux-popup-new b/scripts/tmux-popup-new
new file mode 100755
index 0000000..ebb1800
--- /dev/null
+++ b/scripts/tmux-popup-new
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -eu
+
+if [ "$#" -lt 3 ]; then
+ echo "usage: tmux-popup-new DIRECTORY SESSION_SUFFIX COMMAND [ARG ...]" >&2
+ exit 2
+fi
+
+directory=$1
+suffix=$2
+shift 2
+
+session=$(basename "$directory")$suffix
+
+exec tmux new-session -A -s "$session" -c "$directory" "$@"