-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use shellescape() instead of fnameescape() to escape file names #15
Comments
Hmm, I knew of the difference but somehow assumend that, because Vim's system() is just a wrapper to system-specific functions, it would be fine. (Yes, ':h system' stresses that..) Thanks! |
Do I have to set noshellslash for every casewhen I use shellescape() on win32? |
:help 'shellslash' says:
But many people use it even with cmd.exe because it lets you use forward slashes within Vim easier, and most (but not all) Windows programs in cmd.exe will work with both forward and backwards slashes. It would probably be best, if you also test the value of 'shell' to see whether it actually is still set to start with "command" or "cmd"; shellslash can remain set if a Unix-like shell is actually being used. The reason for resetting 'shellslash' if cmd.exe or similar is in use, is that shellescape() assumes a Unix-like shell if shellslash is set. |
I added a note to 1de08cb, I got it working with a minor modification. Thanks for fixing this! |
In addition, some fnameescape()s used in shell command arguments were changed to shellescape()s, which is more correct. Source: mhinz/vim-signify#15
I had to change fnameescape() to shellescape() to avoid errors when editing files in a path containing spaces in Windows 7.
Something like this needs to be done for all supported VCS types:
fnameescape() is meant for arguments to Vim functions or commands, and shellescape() is meant for arguments to external commands. The system() call is the latter.
The text was updated successfully, but these errors were encountered: