aboutsummaryrefslogtreecommitdiffstats
path: root/src/tmux.sh
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-11-14 11:08:59 -0800
committerEugene Triguba <hello@eugenetriguba.com>2026-11-14 11:08:59 -0800
commit36f7df56164df73c7af867d8ed478a9b572aee40 (patch)
tree0e46940d56b58e2b473b872a8bc4fac9d69a3d33 /src/tmux.sh
parentFix links to docs images in readme and update install instructions (diff)
downloadtmux-toggle-term-36f7df56164df73c7af867d8ed478a9b572aee40.zip
Move source files to src/ directory and add test script to scripts/
Diffstat (limited to 'src/tmux.sh')
-rwxr-xr-xsrc/tmux.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tmux.sh b/src/tmux.sh
new file mode 100755
index 0000000..2be86de
--- /dev/null
+++ b/src/tmux.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -o errexit
+set -o nounset
+
+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"
+}