Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

shellslash setting #6

Closed
ralesi opened this Issue Oct 18, 2011 · 3 comments

Comments

Projects
None yet
2 participants

ralesi commented Oct 18, 2011

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

Owner

xolox commented Oct 18, 2011

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 added a commit that referenced this issue Oct 28, 2011

@xolox 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
Owner

xolox commented Oct 28, 2011

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
Owner

xolox commented May 2, 2013

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

@xolox xolox closed this May 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment