From 7587dd3aaf7aa477935fa6badf679203a4f279ba Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 17 Aug 2025 13:17:54 -0400 Subject: Add ability to use prefix key with key bindings --- scripts/tmux.sh | 17 +++++++++++++++++ scripts/toggle-term.sh | 17 ++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100755 scripts/tmux.sh (limited to 'scripts') 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" +} diff --git a/scripts/toggle-term.sh b/scripts/toggle-term.sh index cd2e5c1..0cc7414 100755 --- a/scripts/toggle-term.sh +++ b/scripts/toggle-term.sh @@ -1,20 +1,11 @@ #!/bin/sh -TMUX_CMD="tmux" +CURRENT_DIR="$(dirname "$0")" +. "$CURRENT_DIR/tmux.sh" + POPUP_SESSION_NAME="popup" main() { - # 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 - + TMUX_CMD=$(get_tmux_cmd) # Modes: # float → global floating window # split → per-window split pane -- cgit v1.2.3