You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug has been bothering me for several weeks by now. Here is the patch:
--- autoload/sy/util.vim.orig 2013-11-27 10:57:13.622643600 +0100+++ autoload/sy/util.vim 2013-11-27 10:47:50.253420800 +0100@@ -6,7 +6,12 @@
function! sy#util#escape(path) abort
if exists('+shellslash')
let old_ssl = &shellslash
- set noshellslash++ if fnamemodify(&shell, ':t') == 'cmd.exe'+ set noshellslash+ else+ set shellslash+ endif
endif
let path = shellescape(a:path)
So, basically, when one starts Vim from Command Prompt (cmd.exe), then &shell points to cmd.exe indeed, and paths for system() call have to be escaped with noshellslash. However, when one starts Vim from Sh, Bash, Ksh, Csh, etc., then &shell points to one of them, and, in this case, paths for system() call have to be escaped with shellslash, otherwise everything breaks because of backward slashes \ in paths.
I've tested this, and I can assure you that it works fine. Please, incorporate this fix upstream. Thank you.
The text was updated successfully, but these errors were encountered:
cmd.exe and PowerShell.exe the only ones to use backward slashes. You're probably more interested not in terminal emulators, but in shells. As for shells, yes: cmd.exe, PowerShell.exe, bash.exe, sh.exe, zsh.exe, ksh.exe, csh.exe. Yes, we have ports of all Unix shell flavors available, and they all use forward slashes.
This bug has been bothering me for several weeks by now. Here is the patch:
So, basically, when one starts Vim from Command Prompt (
cmd.exe
), then&shell
points tocmd.exe
indeed, and paths forsystem()
call have to be escaped withnoshellslash
. However, when one starts Vim from Sh, Bash, Ksh, Csh, etc., then&shell
points to one of them, and, in this case, paths forsystem()
call have to be escaped withshellslash
, otherwise everything breaks because of backward slashes\
in paths.I've tested this, and I can assure you that it works fine. Please, incorporate this fix upstream. Thank you.
The text was updated successfully, but these errors were encountered: