fpf-cli 1.6.21 → 1.6.23

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.
Files changed (2) hide show
  1. package/fpf +24 -6
  2. 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.20"
6
+ SCRIPT_VERSION="1.6.23"
7
7
  TMP_ROOT="${TMPDIR:-/tmp}/fpf"
8
8
  SESSION_TMP_ROOT=""
9
9
  HELP_FILE=""
@@ -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
 
@@ -2792,12 +2792,14 @@ run_fuzzy_selector() {
2792
2792
  local reload_ipc_cmd="${5:-}"
2793
2793
  local script_path="${BASH_SOURCE[0]}"
2794
2794
  local preview_cmd
2795
+ local fzf_shell
2795
2796
 
2796
2797
  if [[ "${script_path}" != /* ]]; then
2797
2798
  script_path="$(pwd)/${script_path}"
2798
2799
  fi
2799
2800
 
2800
2801
  preview_cmd="FPF_SESSION_TMP_ROOT=$(printf '%q' "${SESSION_TMP_ROOT}") ${script_path} --preview-item --manager {1} -- {2}"
2802
+ fzf_shell="$(command -v bash 2>/dev/null || true)"
2801
2803
 
2802
2804
  local -a fzf_args=()
2803
2805
  fzf_args=(-q "${query}" -m \
@@ -2831,7 +2833,11 @@ run_fuzzy_selector() {
2831
2833
  fzf_args+=(--bind="ctrl-r:reload:${reload_cmd}")
2832
2834
  fi
2833
2835
 
2834
- fzf "${fzf_args[@]}" <"${input_file}"
2836
+ if [[ -n "${fzf_shell}" ]]; then
2837
+ SHELL="${fzf_shell}" fzf "${fzf_args[@]}" <"${input_file}"
2838
+ else
2839
+ fzf "${fzf_args[@]}" <"${input_file}"
2840
+ fi
2835
2841
  }
2836
2842
 
2837
2843
  main() {
@@ -3046,11 +3052,20 @@ main() {
3046
3052
 
3047
3053
  local reload_cmd=""
3048
3054
  local reload_ipc_cmd=""
3049
- if [[ "${ACTION}" == "search" && -z "${query}" ]]; then
3055
+ local reload_fallback_file="${display_file}"
3056
+ if [[ "${ACTION}" == "search" ]]; then
3050
3057
  if dynamic_reload_enabled "${#managers[@]}"; then
3051
- reload_cmd="$(build_dynamic_reload_command "${MANAGER_OVERRIDE}" "${display_file}")"
3058
+ if [[ -n "${query}" ]]; then
3059
+ reload_fallback_file="$(mktemp "${SESSION_TMP_ROOT}/reload-fallback.XXXXXX")"
3060
+ collect_search_display_rows "" "${reload_fallback_file}" "${managers[@]-}"
3061
+ if [[ ! -s "${reload_fallback_file}" ]]; then
3062
+ cp "${display_file}" "${reload_fallback_file}"
3063
+ fi
3064
+ fi
3065
+
3066
+ reload_cmd="$(build_dynamic_reload_command "${MANAGER_OVERRIDE}" "${reload_fallback_file}")"
3052
3067
  if fzf_supports_listen; then
3053
- reload_ipc_cmd="$(build_dynamic_query_notify_ipc_command "${MANAGER_OVERRIDE}" "${display_file}")"
3068
+ reload_ipc_cmd="$(build_dynamic_query_notify_ipc_command "${MANAGER_OVERRIDE}" "${reload_fallback_file}")"
3054
3069
  fi
3055
3070
  fi
3056
3071
  fi
@@ -3059,6 +3074,9 @@ main() {
3059
3074
  selected="$(run_fuzzy_selector "${query}" "${display_file}" "${header}" "${reload_cmd}" "${reload_ipc_cmd}" || true)"
3060
3075
 
3061
3076
  rm -f "${display_file}"
3077
+ if [[ "${reload_fallback_file}" != "${display_file}" ]]; then
3078
+ rm -f "${reload_fallback_file}"
3079
+ fi
3062
3080
 
3063
3081
  if [[ -z "${selected}" ]]; then
3064
3082
  log "Selection canceled"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fpf-cli",
3
- "version": "1.6.21",
3
+ "version": "1.6.23",
4
4
  "description": "Cross-platform fuzzy package finder powered by fzf",
5
5
  "bin": {
6
6
  "fpf": "fpf"