roosta.tmux-fuzzback/fuzzback.tmux
Daniel Berg 84cf690881
Fix issue with unsupported bind-key -N option
As pointed out by @k-kuroguro, the `-K` option isn't supported before
tmux 3.1, so I modified the supported.sh script to handle conditionally
setting this option on init

Refs:
1905afb3d8/CHANGES (L806C1-L811C28)
https://github.com/roosta/tmux-fuzzback/issues/24
2025-05-01 22:22:03 +02:00

20 lines
580 B
Bash
Executable file

#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=scripts/helpers.sh
. "$CURRENT_DIR/scripts/helpers.sh"
support_note() {
"$CURRENT_DIR/scripts/supported.sh" "3.1" "" 0 # Pass 0 to suppress message
return $?
}
key="$(tmux_get '@fuzzback-bind' '?')"
table="$(tmux_get '@fuzzback-table' 'prefix')"
if support_note; then
tmux bind-key -N "Fuzzback through pane history" -T "$table" "$key" run -b "$CURRENT_DIR/scripts/fuzzback.sh";
else
tmux bind-key -T "$table" "$key" run -b "$CURRENT_DIR/scripts/fuzzback.sh";
fi