aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/tmux.sh
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-08-17 13:17:54 -0400
committerEugene Triguba <hello@eugenetriguba.com>2025-08-17 13:17:54 -0400
commit7587dd3aaf7aa477935fa6badf679203a4f279ba (patch)
treeb5c0043c9463b7c11c8b9b2232cdbede2f9a9bbe /scripts/tmux.sh
parentupdate changelog (diff)
downloadtmux-toggle-term-0.3.0.zip
Add ability to use prefix key with key bindingsv0.3.0
Diffstat (limited to 'scripts/tmux.sh')
-rwxr-xr-xscripts/tmux.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/tmux.sh b/scripts/tmux.sh
new file mode 100755
index 0000000..b919043
--- /dev/null
+++ b/scripts/tmux.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+get_tmux_cmd() {
+ TMUX_CMD="tmux"
+ # The script supports targeting a different tmux socket
+ # or configuration file solely for testing purposes. This
+ # allows isolation between the tmux installation on the host
+ # and the tmux session for the test run.
+ if [ -n "${TMUX_SOCKET:-}" ]; then
+ if [ -n "${TMUX_CONFIG_PATH:-}" ]; then
+ TMUX_CMD="tmux -f $TMUX_CONFIG_PATH -L $TMUX_SOCKET"
+ else
+ TMUX_CMD="tmux -L $TMUX_SOCKET"
+ fi
+ fi
+ echo "$TMUX_CMD"
+}