rlivings39 / vscode-fzf-quick-open

vscode extension providing quick file/folder open and searching using fzf
MIT License
77 stars 17 forks source link

Check whether term is powershell and escape in the same way as cmd #37

Closed Kamholtz closed 2 years ago

Kamholtz commented 2 years ago

I attempted to use this plugin on my windows machine but none of the commands worked as expected. My integrated terminal seems to use powershell instead of cmd. As an example, when using the command "fzf: Search using rg and fzf" I was presented with the fzf search, but upon pressing enter I received the error message "The specified path is invalid". By hard coding windowsNeedsEscape to false I was able to get the various search commands working. As such I included a check for powershell like so::

let isWindowsCmd = (term?.toLowerCase().endsWith("cmd.exe") || term?.toLowerCase().endsWith("powershell.exe")) ?? false;

so that windowsNeedsEscape ends up being false which prevents the erroneous escaping being applied in powershell.

rlivings39 commented 2 years ago

Huzzah! Thanks @Kamholtz ! I'll get this published in a bit.