Options:
--footer=STR String to print as footer
--footer-border[=STYLE] Draw border around the footer section
[rounded|sharp|bold|block|thinblock|double|horizontal|vertical|
top|bottom|left|right|line|none] (default: line)
--footer-label=LABEL Label to print on the footer border
--footer-label-pos=COL Position of the footer label
[POSITIVE_INTEGER: columns from left|
NEGATIVE_INTEGER: columns from right][:bottom]
(default: 0 or center)
The default border type for footer is 'line', which draws a single
separator between the footer and the list. It changes its position
depending on `--layout`, so you don't have to manually switch between
'top' and 'bottom'
The 'line' style is now supported by other border types as well.
`--list-border` is the only exception.
fzf displayed --header-lines inconsistently depending on the presence of borders:
# --header and --header-lines co-located
seq 10 | fzf --header-lines 3 --header "$(seq 101 103)" --header-first
# --header and --header-lines separated
seq 10 | fzf --header-lines 3 --header "$(seq 101 103)" --header-first --header-lines-border
This commit fixes the inconsistency with the following logic:
* If only one of --header or --header-lines is provided, --header-first
applies to that single header.
* If both are present, --header-first affects only the regular --header,
not --header-lines.
Test cases:
1. 'jump' should show alternating background colors even when 'alt-bg' is
not defined as before.
go run main.go --bind load:jump
Two differences:
* The alternating lines will not be in bold (was a bug)
* The marker column will not be rendered with alternating background color
2. Use alternating background color when 'alt-bg' is set
go run main.go --color bg:238,alt-bg:237
go run main.go --color bg:238,alt-bg:237 --highlight-line
3. 'selected-bg' should take precedence
go run main.go --color bg:238,alt-bg:237,selected-bg:232 \
--highlight-line --multi --bind 'load:select+up+select+up'
4. Should work with text with ANSI colors
declare -f | perl -0777 -pe 's/^}\n/}\0/gm' |
bat --plain --language bash --color always |
go run main.go --read0 --ansi --reverse --multi \
--color bg:237,alt-bg:238,current-bg:236 --highlight-line
---
Close#4354Fix#4372
By default, placeholder expressions are automatically quoted to ensure
they are safely passed as arguments to external programs.
The r flag ({r}, {r1}, etc.) disables this behavior, outputting the
evaluated value without quotes.
For example,
echo 'foo bar' | fzf --preview 'echo {} {r}'
The preview command becomes:
echo 'foo bar' foo bar
Since `{r}` expands to unquoted "foo bar", 'foo' and 'bar' are passed
as separate arguments.
**Use with caution** Unquoted output can lead to broken commands.
echo "let's go" | fzf --preview 'echo {r}'
Close#4330
This option can be used to replace a sed or awk in the post-processing step.
ps -ef | fzf --multi --header-lines 1 | awk '{print $2}'
ps -ef | fzf --multi --header-lines 1 --accept-nth 2
This may not be a very "Unix-y" thing to do, so I've always felt that fzf
shouldn't have such an option, but I've finally changed my mind because:
* fzf can be configured with a custom delimiter that is a fixed string
or a regular expression.
* In such cases, you'd need to repeat the delimiter again in the
post-processing step.
* Also, tools like awk or sed may interpret a regular expression
differently, causing mismatches.
You can still use sed, cut, or awk if you prefer.
Close#3987Close#1323
Close#2890Close#1396
You can't type in queries in this mode, and the only way to trigger an
fzf search is to use `search(...)` action.
# Click header to trigger search
fzf --header '[src] [test]' --no-input --layout reverse \
--header-border bottom --input-border \
--bind 'click-header:transform-search:echo ${FZF_CLICK_HEADER_WORD:1:-1}'