fpf-cli 1.6.20 → 1.6.22
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 +24 -10
- 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.22"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -2509,7 +2509,7 @@ run_ipc_reload_action() {
|
|
|
2509
2509
|
fi
|
|
2510
2510
|
|
|
2511
2511
|
reload_command="$(build_dynamic_reload_command_for_query "${manager_override}" "${fallback_file}" "${query}")"
|
|
2512
|
-
action_payload="
|
|
2512
|
+
action_payload="change-prompt(Search> )+reload(${reload_command})"
|
|
2513
2513
|
send_fzf_listen_action "${action_payload}"
|
|
2514
2514
|
}
|
|
2515
2515
|
|
|
@@ -2526,7 +2526,7 @@ run_ipc_query_notify_action() {
|
|
|
2526
2526
|
fi
|
|
2527
2527
|
|
|
2528
2528
|
if [[ ${#query} -lt ${min_chars} ]]; then
|
|
2529
|
-
send_fzf_prompt_action "Search> " || true
|
|
2529
|
+
run_ipc_reload_action "${query}" || send_fzf_prompt_action "Search> " || true
|
|
2530
2530
|
return 0
|
|
2531
2531
|
fi
|
|
2532
2532
|
|
|
@@ -2542,16 +2542,18 @@ run_ipc_query_notify_action() {
|
|
|
2542
2542
|
target_manager="bun"
|
|
2543
2543
|
fi
|
|
2544
2544
|
|
|
2545
|
-
if [[ "${target_manager}" == "bun" ]] && manager_command_ready bun; then
|
|
2545
|
+
if [[ "${target_manager}" == "bun" ]] && manager_command_ready bun && [[ -n "${FZF_PORT:-}" ]]; then
|
|
2546
2546
|
should_warm_bun=1
|
|
2547
2547
|
fi
|
|
2548
2548
|
|
|
2549
2549
|
send_fzf_prompt_action "Loading> " || true
|
|
2550
2550
|
|
|
2551
2551
|
if [[ "${should_warm_bun}" -eq 1 ]]; then
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2552
|
+
(
|
|
2553
|
+
FPF_IPC_MANAGER_OVERRIDE="${manager_override}" \
|
|
2554
|
+
FPF_IPC_FALLBACK_FILE="${fallback_file}" \
|
|
2555
|
+
manager_search_entries "bun" "${query}" >/dev/null 2>&1 || true
|
|
2556
|
+
) &
|
|
2555
2557
|
fi
|
|
2556
2558
|
|
|
2557
2559
|
run_ipc_reload_action "${query}" || send_fzf_prompt_action "Search> " || true
|
|
@@ -3044,11 +3046,20 @@ main() {
|
|
|
3044
3046
|
|
|
3045
3047
|
local reload_cmd=""
|
|
3046
3048
|
local reload_ipc_cmd=""
|
|
3047
|
-
|
|
3049
|
+
local reload_fallback_file="${display_file}"
|
|
3050
|
+
if [[ "${ACTION}" == "search" ]]; then
|
|
3048
3051
|
if dynamic_reload_enabled "${#managers[@]}"; then
|
|
3049
|
-
|
|
3052
|
+
if [[ -n "${query}" ]]; then
|
|
3053
|
+
reload_fallback_file="$(mktemp "${SESSION_TMP_ROOT}/reload-fallback.XXXXXX")"
|
|
3054
|
+
collect_search_display_rows "" "${reload_fallback_file}" "${managers[@]-}"
|
|
3055
|
+
if [[ ! -s "${reload_fallback_file}" ]]; then
|
|
3056
|
+
cp "${display_file}" "${reload_fallback_file}"
|
|
3057
|
+
fi
|
|
3058
|
+
fi
|
|
3059
|
+
|
|
3060
|
+
reload_cmd="$(build_dynamic_reload_command "${MANAGER_OVERRIDE}" "${reload_fallback_file}")"
|
|
3050
3061
|
if fzf_supports_listen; then
|
|
3051
|
-
reload_ipc_cmd="$(build_dynamic_query_notify_ipc_command "${MANAGER_OVERRIDE}" "${
|
|
3062
|
+
reload_ipc_cmd="$(build_dynamic_query_notify_ipc_command "${MANAGER_OVERRIDE}" "${reload_fallback_file}")"
|
|
3052
3063
|
fi
|
|
3053
3064
|
fi
|
|
3054
3065
|
fi
|
|
@@ -3057,6 +3068,9 @@ main() {
|
|
|
3057
3068
|
selected="$(run_fuzzy_selector "${query}" "${display_file}" "${header}" "${reload_cmd}" "${reload_ipc_cmd}" || true)"
|
|
3058
3069
|
|
|
3059
3070
|
rm -f "${display_file}"
|
|
3071
|
+
if [[ "${reload_fallback_file}" != "${display_file}" ]]; then
|
|
3072
|
+
rm -f "${reload_fallback_file}"
|
|
3073
|
+
fi
|
|
3060
3074
|
|
|
3061
3075
|
if [[ -z "${selected}" ]]; then
|
|
3062
3076
|
log "Selection canceled"
|