Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions zfsbootmenu/install-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ create_zbm_conf() {
has_border=1
fi

# Check if fuzzy finder supports --raw flag
# Added in fzf 0.66.0

local has_raw
if echo "abc" | fzf -f "abc" --raw --exit-0 >/dev/null 2>&1; then
has_raw=1
fi

local has_column
if command -v column >/dev/null 2>&1 ; then
has_column=1
Expand Down Expand Up @@ -132,6 +140,7 @@ create_zbm_conf() {
export HAS_DISABLED="${has_disabled}"
export HAS_BORDER="${has_border}"
export HAS_COLUMN="${has_column}"
export HAS_RAW="${has_raw}"
export ZBM_BUILDSTYLE="${ZBM_BUILDSTYLE}"
export ZBM_RELEASE_BUILD="${zfsbootmenu_release_build}"
EOF
Expand Down
9 changes: 9 additions & 0 deletions zfsbootmenu/lib/fzf-defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ if [ ${loglevel:-4} -eq 7 ] ; then
)
fi

if [ -n "${HAS_RAW}" ]; then
fuzzy_default_options+=(
"--raw"
"--bind" '"result:best"'
"--bind" '"up:up-match"'
"--bind" '"down:down-match"'
)
fi

export FUZZYSEL=fzf
export PREVIEW_HEIGHT=2
export FZF_DEFAULT_OPTS="${fuzzy_default_options[*]}"