Closed smashgen closed 3 weeks ago
The transform
[^1] action enables the user to execute an action conditionally.
The fzf tool sets the environment variable FZF_SELECT_COUNT
[^2]. If no selections are present, the operation is aborted. Otherwise, it deselects the matches upon pressing ⌃ Control + A.
look foo | fzf --multi \
--bind 'load:select-all' \
--bind 'ctrl-a:transform:((FZF_SELECT_COUNT)) &&
echo "deselect-all" ||
echo "abort"'
[^1]: changelog 0.45.0 [^2]: changelog 0.46.0
Checklist
man fzf
)Output of
fzf --version
0.50 (devel)
OS
Shell
Problem / Steps to reproduce
I checked the man page and I don't think there is an action that already does this. I think it would be useful to have an action that clears selections if there are any else exit fzf, similar to the cancel action.