Close#4430
Example:
# Implement popup that disappears after 1 second
# * Use footer as the popup
# * Use `bell` to ring the terminal bell
# * Use `bg-transform-footer` to clear the footer after 1 second
# * Use `bg-cancel` to ignore currently running background transform actions
fzf --multi --list-border \
--bind 'enter:execute-silent(echo -n {+} | pbcopy)+bell' \
--bind 'enter:+transform-footer(echo Copied {} to clipboard)' \
--bind 'enter:+bg-cancel+bg-transform-footer(sleep 1)'
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.
fzf would restore the original query in input-less mode after executing
a chain of actions.
This commit changes the behavior so that the restoration
happens after each action to allow something like
'show-input+change-query(...)+hide-input'.
Fix#4326
Enable inserting multiple history commands. To disable, set `--no-multi`
through `$FZF_CTRL_R_OPTS`.
Also, remove the usage of `become` action, to avoid leaving behind
temporary files.
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
When --nth is used with a custom --delimiter, the last delimiter was
included in the search scope, forcing you to write the delimiter in
a suffix-match query. This commit removes the last delimiter from the
search scope.
# No need to write 'bar,$'
echo foo,bar,baz | fzf --delimiter , --nth 2 --filter 'bar$'
This can be seen as a breaking change, but I'm gonna say it's a bug fix.
Fix#3983
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