Closed malkomalko closed 1 month ago
Yes, s
flags does not preserve record separators. They are removed right away when fzf reads the lines.
You can use printf
instead or use for
loop over the values.
ls -al | fzf --header-lines=1 --multi --bind 'ctrl-y:select-all+become(printf "%s\n" {+3..} | pbcopy)'
ls -al | fzf --header-lines=1 --multi --bind 'ctrl-y:select-all+become(for x in {+3..}; do echo "$x"; done | pbcopy)'
Checklist
man fzf
)Output of
fzf --version
0.52.1 (brew)
OS
Shell
Problem / Steps to reproduce
I have a binding that I'm trying to make work that selects all visible results and copies them to the clipboard:
--bind "ctrl-y:select-all+execute-silent(echo -n {+s3..} | pbcopy)+abort"
It works, but the output is all one line. I was expecting the s flag to preserve the whitespace. Is this the intended outcome?