From cd3885855692653a4ac7a48adabc60009e70a8ef Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 23 Nov 2026 18:32:47 -0800 Subject: Change toggle term float and split key defaults - `@toggle-term-float-key` now defaults to `f`. - `@toggle-term-split-key` now defaults to `;`. --- tests/tmux.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/tmux.sh (limited to 'tests/tmux.sh') diff --git a/tests/tmux.sh b/tests/tmux.sh new file mode 100644 index 0000000..23c2700 --- /dev/null +++ b/tests/tmux.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bats + +tmux_new_session() { + tmux_cmd new-session -d -s "$1" +} + +tmux_kill_server() { + tmux_cmd kill-server || true +} + +tmux_pane_count() { + num_panes=$(tmux_cmd list-panes | wc -l | sed 's/^[[:space:]]*//g') + echo "$num_panes" +} + +tmux_active_panes() { + active_panes=$(tmux_cmd list-panes -F '#{pane_active}' | tr '\n' '-' | sed 's/-$//g') + echo "$active_panes" +} + +tmux_is_zoomed() { + is_zoomed=$(tmux_cmd list-panes -F '#{window_zoomed_flag}') + if echo "$is_zoomed" | grep -q 1; then + echo 'true' + else + echo 'false' + fi +} + +tmux_set_option() { + option="$1" + value="$2" + tmux_cmd set-option -g "$option" "$value" +} + +tmux_get_key_bindings() { + tmux_cmd list-keys 2>/dev/null | grep "toggle-term" || echo "" +} + +tmux_cmd() { + tmux -f "$TMUX_CONFIG_PATH" -L "$TMUX_SOCKET" "$@" +} + +tmux_has_prefix_binding() { + key="$1" + mode="$2" + tmux_get_key_bindings | grep -q "bind-key.*-T prefix.*${key}.*toggle-term.sh $mode" +} + +tmux_has_root_binding() { + key="$1" + mode="$2" + tmux_get_key_bindings | grep -q "bind-key.*-T root.*\"*${key}\"*.*toggle-term.sh $mode" +} -- cgit v1.2.3