fpf-cli 1.6.22 → 1.6.24
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/README.md +2 -1
- package/fpf +25 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,7 +89,8 @@ Installed packages are marked with `*` in the result list.
|
|
|
89
89
|
- If `fzf` is missing, `fpf` auto-installs it using a compatible detected manager.
|
|
90
90
|
- Root managers (`apt`, `dnf`, `pacman`, `zypper`, `emerge`, `snap`) use `sudo` when needed.
|
|
91
91
|
- `FPF_DYNAMIC_RELOAD`: `always` (default), `single`, or `never`
|
|
92
|
-
-
|
|
92
|
+
- Live reload uses `change:reload` by default for reliability (`ctrl-r` uses the same reload command).
|
|
93
|
+
- Set `FPF_DYNAMIC_RELOAD_TRANSPORT=ipc` to opt into `--listen` + IPC query notifications on supported `fzf` builds.
|
|
93
94
|
- `FPF_RELOAD_MIN_CHARS`: minimum query length before live reload (default `2`)
|
|
94
95
|
- `FPF_RELOAD_DEBOUNCE`: reload debounce seconds (default `0.12`)
|
|
95
96
|
- `FPF_DISABLE_INSTALLED_CACHE=1` disables installed-package marker cache
|
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.24"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -1463,6 +1463,22 @@ dynamic_reload_enabled() {
|
|
|
1463
1463
|
esac
|
|
1464
1464
|
}
|
|
1465
1465
|
|
|
1466
|
+
dynamic_reload_use_ipc() {
|
|
1467
|
+
local transport="${FPF_DYNAMIC_RELOAD_TRANSPORT:-reload}"
|
|
1468
|
+
|
|
1469
|
+
case "${transport}" in
|
|
1470
|
+
ipc|listen|http)
|
|
1471
|
+
fzf_supports_listen
|
|
1472
|
+
;;
|
|
1473
|
+
auto)
|
|
1474
|
+
fzf_supports_listen
|
|
1475
|
+
;;
|
|
1476
|
+
*)
|
|
1477
|
+
return 1
|
|
1478
|
+
;;
|
|
1479
|
+
esac
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1466
1482
|
rank_display_rows_by_query() {
|
|
1467
1483
|
local query="$1"
|
|
1468
1484
|
local input_file="$2"
|
|
@@ -2792,12 +2808,14 @@ run_fuzzy_selector() {
|
|
|
2792
2808
|
local reload_ipc_cmd="${5:-}"
|
|
2793
2809
|
local script_path="${BASH_SOURCE[0]}"
|
|
2794
2810
|
local preview_cmd
|
|
2811
|
+
local fzf_shell
|
|
2795
2812
|
|
|
2796
2813
|
if [[ "${script_path}" != /* ]]; then
|
|
2797
2814
|
script_path="$(pwd)/${script_path}"
|
|
2798
2815
|
fi
|
|
2799
2816
|
|
|
2800
2817
|
preview_cmd="FPF_SESSION_TMP_ROOT=$(printf '%q' "${SESSION_TMP_ROOT}") ${script_path} --preview-item --manager {1} -- {2}"
|
|
2818
|
+
fzf_shell="$(command -v bash 2>/dev/null || true)"
|
|
2801
2819
|
|
|
2802
2820
|
local -a fzf_args=()
|
|
2803
2821
|
fzf_args=(-q "${query}" -m \
|
|
@@ -2831,7 +2849,11 @@ run_fuzzy_selector() {
|
|
|
2831
2849
|
fzf_args+=(--bind="ctrl-r:reload:${reload_cmd}")
|
|
2832
2850
|
fi
|
|
2833
2851
|
|
|
2834
|
-
|
|
2852
|
+
if [[ -n "${fzf_shell}" ]]; then
|
|
2853
|
+
SHELL="${fzf_shell}" fzf "${fzf_args[@]}" <"${input_file}"
|
|
2854
|
+
else
|
|
2855
|
+
fzf "${fzf_args[@]}" <"${input_file}"
|
|
2856
|
+
fi
|
|
2835
2857
|
}
|
|
2836
2858
|
|
|
2837
2859
|
main() {
|
|
@@ -3058,7 +3080,7 @@ main() {
|
|
|
3058
3080
|
fi
|
|
3059
3081
|
|
|
3060
3082
|
reload_cmd="$(build_dynamic_reload_command "${MANAGER_OVERRIDE}" "${reload_fallback_file}")"
|
|
3061
|
-
if
|
|
3083
|
+
if dynamic_reload_use_ipc; then
|
|
3062
3084
|
reload_ipc_cmd="$(build_dynamic_query_notify_ipc_command "${MANAGER_OVERRIDE}" "${reload_fallback_file}")"
|
|
3063
3085
|
fi
|
|
3064
3086
|
fi
|