Bug: previewer cmd cannot have spaces (windows)
RTFM Checklist
- [x] I have searched exisiting issues / discussions
- [x] I have read the Wiki including the Advanced section
- [x] I have read
man fzf/ I am well versed in shell fzf
Operating system
windows 11
Shell
pwsh
Neovim version (nvim --version)
NVIM v0.11.2
Fzf version (fzf --version)
0.62.0
Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))
nil
Is the problem reproducible with mini.sh?
- [ ] My issue is reproducible with
mini.sh - [ ] My issue IS NOT reproducible with
mini.sh - [X] I have not tested with
mini.sh(not relevant, requires LSP, Windows, etc)
Fzf-lua configuration
require('fzf-lua').setup({
'telescope',
{ previewers = { bat = { cmd = [[C:\some path with spaces\bin\bat.exe]] } } }
})
Describe the bug / steps to reproduce
preview window will complain that C:\some is not a command; the actual C:\some path with spaces\bin\bat.exe command is not run, but its path is being cut/split into its spaces
I don’t have access to my windows VM anymore, can you try this (if the below works I’ll fix it in the code):
require('fzf-lua').setup({
'telescope',
{ previewers = { bat = { cmd = FzfLua.libuv.shellescape [[C:\some path with spaces\bin\bat.exe]] } } }
})
ooh, that works alright. Thanks
closing
ooh, that works alright. Thanks
closing
I can add automatic escaping to the previewer code as well.
I don't have it with me right now, but I remember some "launch process" function had unsolvable-in-the-near-future problems with spaces (maybe uv.spawn()?)
so I would not add any code if "spaces in command path" is not a problem... yet
Alright we can leave it as is for now, if this becomes an issue I can always add automatic escape in the code.