jethrokuan / fzf

Ef-🐟-ient fish keybindings for fzf
MIT License
862 stars 65 forks source link

Tab completion does not handle spaces well #152

Open justinlovinger opened 4 years ago

justinlovinger commented 4 years ago

If a file has spaces, tab completion does not escape the spaces or surround with quotes.

Additionally, if preview is enabled, fzf only shows files up to the first space. I believe this is related to with-nth=1. The preview also breaks when a file has a space. Up to the first space is passed as the first argument to __fzf_complete_preview, with everything after the first space passed as the 2nd, 3rd, etc. arguments.

justinlovinger commented 4 years ago

It looks like FZF_ENABLE_OPEN_PREVIEW has similar issues with spaces in preview. I got fzf preview working with --preview-window=right:wrap --preview="__fzf_complete_preview {}".

jswny commented 4 years ago

This is a known issue and unfortunately looks like it's a problem upstream with complete -C. See this issue for more: https://github.com/jethrokuan/fzf/issues/122.