Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

shellslash setting #6

Closed
ralesi opened this Issue · 3 comments

2 participants

@ralesi

If I set shellslash in my vimrc for both linux and windows environments (I like uniform front slashes everywhere, even windows). I get this error when starting up with easytags on windows:

shell.vim 0.9.13: Failed to get output of command "C:\Windows\system32\cm
d.exe /c ctags --version > 'C:/Users/walesi/AppData/Local/Temp/VIA9EB2.tm
p' 2>&1"! at function 49_InitEasyTags..49_CheckCtags..xolox#sh
ell#execute, line 32

easytags.vim 2.7: Plug-in not loaded because Exuberant Ctags isn't installed!
Please download & install Exuberant Ctags from http://ctags.sf.net

It all comes down to the part in autoload/xolox/shell.vim with the shellescape()

105 if a:synchronous
106 let tempout = tempname()
107 let cmd .= ' > ' . shellescape(tempout) . ' 2>&1'
108 endif

The double quotes from the shellescape() are what make the temp file access impossible in the execute command. I can fix the problem by removing the shellescape, but I don't know if that is the only way

@xolox
Owner

The double quotes from the shellescape() are what make the temp file access impossible in the execute command. I can fix the problem by removing the shellescape, but I don't know if that is the only way

I guess you meant to say single quotes?

The problem is that Vim's 'shellslash' setting controls more than just the type of slashes used in filenames; as you found out it also controls whether command line arguments to external commands are quoted with double quotes (the default on Windows) or single quotes. However single quotes are never a valid quoting mechanism in the default Windows shell CMD.EXE -- single quotes only work if you use a UNIX style shell under Windows (don't ask me why but some people do this -- I've never tried it).

I've had previous reports about this issue. Maybe the shell plug-in should just temporarily reset the 'shellslash' option during its execution and restore the original user defined value afterwards. IIUC you should never notice the difference except that the shell plug-in will actually work out of the box :-).

@xolox xolox referenced this issue from a commit
@xolox Workaround &shellslash option on Windows (issue #6)
I'm not sure if this is the right thing to do but I've had several
"bug reports" about this option breaking my plug-ins. What I'm not
sure about is whether this option has a legitimate use case that
I'm breaking with this change...

TODO If I don't get any complaints about this change I may have to
move xolox#shell#escape() to xolox#misc#os#shellescape() and use it
in my other plug-ins as well?
942e75a
@xolox
Owner

Hi Rich,

I just published a new version of the vim-shell plug-in that should fix the issue you reported. If you try it out please let me know whether it resolves the issue for you.

- Peter

@xolox
Owner

Closing old issues. If this is still a problem feel free to reopen this issue.

@xolox xolox closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.