fpf-cli 1.6.40 → 1.6.41
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 +1 -0
- package/fpf +27 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,6 +102,7 @@ Installed packages are marked with `*` in the result list.
|
|
|
102
102
|
- Set `FPF_LOADING_INDICATOR=0` to disable the pre-search loading indicator.
|
|
103
103
|
- `FPF_RELOAD_MIN_CHARS`: minimum query length before live reload (default `2`)
|
|
104
104
|
- `FPF_RELOAD_DEBOUNCE`: reload debounce seconds (default `0.12`)
|
|
105
|
+
- `FPF_DYNAMIC_RELOAD_BYPASS_QUERY_CACHE=1`: force uncached reload queries (legacy behavior); default `0` uses query cache during reloads
|
|
105
106
|
- `FPF_ENABLE_QUERY_CACHE`: `auto` (default), `1`, or `0` (`auto` enables query cache for `apt`, `brew`, `pacman`, and `bun`)
|
|
106
107
|
- `FPF_QUERY_CACHE_TTL`: default query-cache TTL seconds for heavy manager caches (default `300`)
|
|
107
108
|
- `FPF_APT_QUERY_CACHE_TTL`, `FPF_BREW_QUERY_CACHE_TTL`, `FPF_PACMAN_QUERY_CACHE_TTL`: per-manager query-cache TTL overrides
|
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.41"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -80,6 +80,22 @@ query_cache_ttl_seconds_for_manager() {
|
|
|
80
80
|
printf "%s" "${manager_ttl}"
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
dynamic_reload_query_cache_bypass_value() {
|
|
84
|
+
local bypass_setting="${FPF_DYNAMIC_RELOAD_BYPASS_QUERY_CACHE:-0}"
|
|
85
|
+
|
|
86
|
+
bypass_setting="$(trim_whitespace "${bypass_setting}")"
|
|
87
|
+
bypass_setting="$(printf "%s" "${bypass_setting}" | tr '[:upper:]' '[:lower:]')"
|
|
88
|
+
|
|
89
|
+
case "${bypass_setting}" in
|
|
90
|
+
1|true|yes|on)
|
|
91
|
+
printf "1"
|
|
92
|
+
;;
|
|
93
|
+
*)
|
|
94
|
+
printf "0"
|
|
95
|
+
;;
|
|
96
|
+
esac
|
|
97
|
+
}
|
|
98
|
+
|
|
83
99
|
log() {
|
|
84
100
|
printf "%s\n" "$*" >&2
|
|
85
101
|
}
|
|
@@ -3191,6 +3207,7 @@ build_dynamic_reload_command() {
|
|
|
3191
3207
|
local script_path="${BASH_SOURCE[0]}"
|
|
3192
3208
|
local min_chars="${FPF_RELOAD_MIN_CHARS:-2}"
|
|
3193
3209
|
local reload_debounce="${FPF_RELOAD_DEBOUNCE:-0.12}"
|
|
3210
|
+
local bypass_query_cache="1"
|
|
3194
3211
|
|
|
3195
3212
|
if ! [[ "${min_chars}" =~ ^[0-9]+$ ]]; then
|
|
3196
3213
|
min_chars=2
|
|
@@ -3200,14 +3217,16 @@ build_dynamic_reload_command() {
|
|
|
3200
3217
|
reload_debounce=0.12
|
|
3201
3218
|
fi
|
|
3202
3219
|
|
|
3220
|
+
bypass_query_cache="$(dynamic_reload_query_cache_bypass_value)"
|
|
3221
|
+
|
|
3203
3222
|
if [[ "${script_path}" != /* ]]; then
|
|
3204
3223
|
script_path="$(pwd)/${script_path}"
|
|
3205
3224
|
fi
|
|
3206
3225
|
|
|
3207
3226
|
if [[ -n "${manager_override}" ]]; then
|
|
3208
|
-
printf 'q={q}; if [ ${#q} -lt %s ]; then cat %q; else sleep %s; FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE
|
|
3227
|
+
printf 'q={q}; if [ ${#q} -lt %s ]; then cat %q; else sleep %s; FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE=%s FPF_IPC_MANAGER_OVERRIDE=%q FPF_IPC_FALLBACK_FILE=%q %q --feed-search --manager %q -- "$q" 2>/dev/null || cat %q; fi' "${min_chars}" "${fallback_file}" "${reload_debounce}" "${bypass_query_cache}" "${manager_override}" "${fallback_file}" "${script_path}" "${manager_override}" "${fallback_file}"
|
|
3209
3228
|
else
|
|
3210
|
-
printf 'q={q}; if [ ${#q} -lt %s ]; then cat %q; else sleep %s; FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE
|
|
3229
|
+
printf 'q={q}; if [ ${#q} -lt %s ]; then cat %q; else sleep %s; FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE=%s FPF_IPC_MANAGER_OVERRIDE= FPF_IPC_FALLBACK_FILE=%q %q --feed-search -- "$q" 2>/dev/null || cat %q; fi' "${min_chars}" "${fallback_file}" "${reload_debounce}" "${bypass_query_cache}" "${fallback_file}" "${script_path}" "${fallback_file}"
|
|
3211
3230
|
fi
|
|
3212
3231
|
}
|
|
3213
3232
|
|
|
@@ -3218,6 +3237,7 @@ build_dynamic_reload_command_for_query() {
|
|
|
3218
3237
|
local script_path="${BASH_SOURCE[0]}"
|
|
3219
3238
|
local min_chars="${FPF_RELOAD_MIN_CHARS:-2}"
|
|
3220
3239
|
local reload_debounce="${FPF_RELOAD_DEBOUNCE:-0.12}"
|
|
3240
|
+
local bypass_query_cache="1"
|
|
3221
3241
|
|
|
3222
3242
|
if ! [[ "${min_chars}" =~ ^[0-9]+$ ]]; then
|
|
3223
3243
|
min_chars=2
|
|
@@ -3227,6 +3247,8 @@ build_dynamic_reload_command_for_query() {
|
|
|
3227
3247
|
reload_debounce=0.12
|
|
3228
3248
|
fi
|
|
3229
3249
|
|
|
3250
|
+
bypass_query_cache="$(dynamic_reload_query_cache_bypass_value)"
|
|
3251
|
+
|
|
3230
3252
|
if [[ "${script_path}" != /* ]]; then
|
|
3231
3253
|
script_path="$(pwd)/${script_path}"
|
|
3232
3254
|
fi
|
|
@@ -3237,9 +3259,9 @@ build_dynamic_reload_command_for_query() {
|
|
|
3237
3259
|
fi
|
|
3238
3260
|
|
|
3239
3261
|
if [[ -n "${manager_override}" ]]; then
|
|
3240
|
-
printf 'sleep %s; FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE
|
|
3262
|
+
printf 'sleep %s; FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE=%s FPF_IPC_MANAGER_OVERRIDE=%q FPF_IPC_FALLBACK_FILE=%q %q --feed-search --manager %q -- %q 2>/dev/null || cat %q' "${reload_debounce}" "${bypass_query_cache}" "${manager_override}" "${fallback_file}" "${script_path}" "${manager_override}" "${query_value}" "${fallback_file}"
|
|
3241
3263
|
else
|
|
3242
|
-
printf 'sleep %s; FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE
|
|
3264
|
+
printf 'sleep %s; FPF_SKIP_INSTALLED_MARKERS=1 FPF_BYPASS_QUERY_CACHE=%s FPF_IPC_MANAGER_OVERRIDE= FPF_IPC_FALLBACK_FILE=%q %q --feed-search -- %q 2>/dev/null || cat %q' "${reload_debounce}" "${bypass_query_cache}" "${fallback_file}" "${script_path}" "${query_value}" "${fallback_file}"
|
|
3243
3265
|
fi
|
|
3244
3266
|
}
|
|
3245
3267
|
|