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.
For the line "Host host1 # this is a comment", the current
implementation generates words in an inline comment as hostnames.
This patch removes the comment before generating the hostname.
In ~/.ssh/config, "=" can also be used as a separator between the
field name and the value. The current master does not properly handle
this and generate a hostname "=" or one starting with "=". This patch
correctly handles it.
Comments are anyway removed in the subsequent call to `sub(/#.*/,
"")`, and it becomes a blank line. Blank lines do not have fields, so
they are ignored in the next for-loop.