fpf-cli 1.6.27 → 1.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fpf +32 -5
- package/package.json +1 -1
package/fpf
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
SCRIPT_NAME="fpf"
|
|
6
|
-
SCRIPT_VERSION="1.6.
|
|
6
|
+
SCRIPT_VERSION="1.6.29"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -2495,6 +2495,24 @@ fzf_supports_listen() {
|
|
|
2495
2495
|
[[ "${fzf_help}" == *"--listen"* ]]
|
|
2496
2496
|
}
|
|
2497
2497
|
|
|
2498
|
+
fzf_supports_result_bind() {
|
|
2499
|
+
if [[ -n "${FPF_FZF_RESULT_BIND_SUPPORTED_CACHE:-}" ]]; then
|
|
2500
|
+
[[ "${FPF_FZF_RESULT_BIND_SUPPORTED_CACHE}" == "1" ]]
|
|
2501
|
+
return
|
|
2502
|
+
fi
|
|
2503
|
+
|
|
2504
|
+
local probe_output=""
|
|
2505
|
+
probe_output="$(printf 'probe\n' | fzf --bind='result:abort' --filter probe 2>&1 >/dev/null || true)"
|
|
2506
|
+
|
|
2507
|
+
if [[ "${probe_output}" == *"unsupported key: result"* ]]; then
|
|
2508
|
+
FPF_FZF_RESULT_BIND_SUPPORTED_CACHE="0"
|
|
2509
|
+
return 1
|
|
2510
|
+
fi
|
|
2511
|
+
|
|
2512
|
+
FPF_FZF_RESULT_BIND_SUPPORTED_CACHE="1"
|
|
2513
|
+
return 0
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2498
2516
|
send_fzf_listen_action() {
|
|
2499
2517
|
local action_payload="$1"
|
|
2500
2518
|
local listen_target="${FZF_PORT:-}"
|
|
@@ -2953,13 +2971,22 @@ run_fuzzy_selector() {
|
|
|
2953
2971
|
fzf_args+=(--listen=0)
|
|
2954
2972
|
fzf_args+=(--bind="change:execute-silent:${reload_ipc_cmd}")
|
|
2955
2973
|
if [[ -n "${reload_cmd}" ]]; then
|
|
2974
|
+
if fzf_supports_result_bind; then
|
|
2975
|
+
fzf_args+=(--bind="ctrl-r:change-prompt(Loading> )+reload:${reload_cmd}")
|
|
2976
|
+
fzf_args+=(--bind="result:change-prompt(Search> )")
|
|
2977
|
+
else
|
|
2978
|
+
fzf_args+=(--bind="ctrl-r:reload:${reload_cmd}")
|
|
2979
|
+
fi
|
|
2980
|
+
fi
|
|
2981
|
+
elif [[ -n "${reload_cmd}" ]]; then
|
|
2982
|
+
if fzf_supports_result_bind; then
|
|
2983
|
+
fzf_args+=(--bind="change:change-prompt(Loading> )+reload:${reload_cmd}")
|
|
2956
2984
|
fzf_args+=(--bind="ctrl-r:change-prompt(Loading> )+reload:${reload_cmd}")
|
|
2957
2985
|
fzf_args+=(--bind="result:change-prompt(Search> )")
|
|
2986
|
+
else
|
|
2987
|
+
fzf_args+=(--bind="change:reload:${reload_cmd}")
|
|
2988
|
+
fzf_args+=(--bind="ctrl-r:reload:${reload_cmd}")
|
|
2958
2989
|
fi
|
|
2959
|
-
elif [[ -n "${reload_cmd}" ]]; then
|
|
2960
|
-
fzf_args+=(--bind="change:change-prompt(Loading> )+reload:${reload_cmd}")
|
|
2961
|
-
fzf_args+=(--bind="ctrl-r:change-prompt(Loading> )+reload:${reload_cmd}")
|
|
2962
|
-
fzf_args+=(--bind="result:change-prompt(Search> )")
|
|
2963
2990
|
fi
|
|
2964
2991
|
|
|
2965
2992
|
if [[ -n "${fzf_shell}" ]]; then
|