vim-misc icon indicating copy to clipboard operation
vim-misc copied to clipboard

On Windows, using "start!" in xolox#misc#os#exec requires escaping # characters

Open alexpolozov opened this issue 11 years ago • 2 comments

If we want to make an asynchronous call on Windows without using the DLL, the function xolox#misc#os#exec does a !start call. However, the command string includes all the client function names etc., which have some # characters in them. Vim then complains when trying to execute this command:

E194: No alternate file name to substitute for '#'

I am unable to prepare a proper pull request at the moment, but a simple fix would be to escape the # characters in the cmd variable somewhere around os.vim:181.

alexpolozov avatar Nov 07 '14 02:11 alexpolozov

Changing shellescape(a:string) to shellescape(a:string,1) in escape.vim might be the solution to this. That causes !, %, # to be escaped before they're sent to :! and unescaped before they're sent to the shell.

I haven't looked to see where xolox#misc#escape#shell is used, so it might just need a cmd=shellescape(cmd,1) before the !start call. Either way cleans up the error spew in easytags, at least.

As a bit of justification for going without the dll, shellouts on Windows work almost as well as on Linux as long as you have a copy of tee on your path and something like this in your .vimrc:

if executable("tee")
    set shellpipe=2>&1\|\ tee
    set noshelltemp
    set nomore
endif

NonWonderDog avatar May 21 '15 18:05 NonWonderDog

Hi @apskim and @NonWonderDog and thanks for the feedback. I just released vim-misc 1.17.6 which hopefully resolves this issue. I haven't had access to a Windows system for a long time so unfortunately I can't confirm the fix myself. Can one of you try it out and let me know whether the latest version resolves the issue you reported?

xolox avatar May 21 '15 18:05 xolox