mhinz / vim-grepper

:space_invader: Helps you win at grep.
MIT License
1.22k stars 58 forks source link

Do not assume shell for platform #254

Open Sh3Rm4n opened 3 years ago

Sh3Rm4n commented 3 years ago

win32 does not necessarily mean cmd.exe as well as others does not mean sh.

Problem is, that previous functions, like s:escape_cword() do respect shell e.g. with shellescape(), but passing the arguments to job_start() / jobstart() does ignore shell.

This leads to trouble. E.g. I use fish, where shellescape() escapes \, which means if <cword> / -cword is used (e.g. Aword), s:escape_cword() results to \\bAword\\b (which is correct), but this string is then passed to jobstart() executed by sh, which does not share the same escaping rules.