Describe the bug
I've exhausted all options and followed the documentation but am unable to get :! {cmd} to work with the following shell configuration:
set shell=\"$PROGRAMW6432\Git\bin\bash.exe\"
I've also the tried the following and more:
set shell=$PROGRAMW6432\Git\bin\bash.exe
set shell=$PROGRAMW6432/Git/bin/bash.exe
set shell=\"\"$PROGRAMW6432/Git/bin/bash.exe\"\"
set shell=\'\"$PROGRAMW6432/Git/bin/bash.exe\"\'
set shell=\"\'$PROGRAMW6432/Git/bin/bash.exe\'\"
set shell=\'$PROGRAMW6432/Git/bin/bash.exe\'
set shell=\"C:\Program Files\Git\bin\bash.exe\"
set shell=\"C:\Program\ Files\Git\bin\bash.exe\"
set shell=\"C:\Program\\ Files\Git\bin\bash.exe\"
set shell=\"C:\Program\\\ Files\Git\bin\bash.exe\"
set shell=C:\Program\\\ Files\Git\bin\bash.exe
...
To Reproduce
vim -u .vimrc where .vimrc contains the single set shell line of configuration.:!lsExpected behavior
The {cmd} is executed in the configured shell.
Environment:
VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:36:07)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1
Compiled by mool@tororo
Huge version with GUI. Features included (+) or not (-):
+acl +channel +cryptv -ebcdic +folding +lambda +mksession +ole +python3/dyn +statusline -tgetent +visual -xfontset
+arabic +cindent +cscope +emacs_tags -footer +langmap +modify_fname +packages +quickfix -sun_workshop -termresponse +visualextra -xim
+autocmd +clientserver +cursorbind +eval +gettext/dyn +libcall +mouse +path_extra +reltime +syntax +textobjects +viminfo +xpm_w32
+autoservername +clipboard +cursorshape +ex_extra -hangul_input +linebreak +mouseshape +perl/dyn +rightleft +tag_binary +timers +vreplace -xterm_save
+balloon_eval +cmdline_compl +dialog_con_gui +extra_search +iconv/dyn +lispindent +multi_byte_ime/dyn +persistent_undo +ruby/dyn +tag_old_static +title -vtp
-balloon_eval_term +cmdline_hist +diff +farsi +insert_expand +listcmds +multi_lang -postscript +scrollbind -tag_any_white +toolbar +wildignore
+browse +cmdline_info +digraphs +file_in_path +job +localmap +mzscheme/dyn +printer +signs +tcl/dyn +user_commands +wildmenu
++builtin_terms +comments +directx +find_in_path +jumplist +lua/dyn +netbeans_intg +profile +smartindent -termguicolors +vertsplit +windows
+byte_offset +conceal -dnd +float +keymap +menu +num64 +python/dyn +startuptime +terminal +virtualedit +writebackup
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME\_vimrc"
2nd user vimrc file: "$HOME\vimfiles\vimrc"
3rd user vimrc file: "$VIM\_vimrc"
user exrc file: "$HOME\_exrc"
2nd user exrc file: "$VIM\_exrc"
system gvimrc file: "$VIM\gvimrc"
user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
defaults file: "$VIMRUNTIME\defaults.vim"
system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_TERMINAL -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL -DFEAT_XPM_W32 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG /arch:IA32 /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_GUI_W32 -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86t.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python36.dll\" -DFEAT_MZSCHEME -I "E:\Racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracket3m_a36fs8.dll\" -DDYNAMIC_MZGC_DLL=\"libracket3m_a36fs8.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl524.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=24 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby240.dll\" -DFEAT_HUGE /Fd.\ObjGXOULYHTRZi386/ /Zi
Linking: link /nologo /subsystem:windows,5.01 /opt:ref /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:i386 gdi32.lib version.lib winspool.lib comctl32.lib advapi32.lib shell32.lib /machine:i386 libcmt.lib oleaut32.lib user32.lib /nodefaultlib:lua53.lib /STACK:8388608 /nodefaultlib:python27.lib /nodefaultlib:python36.lib "E:\ActiveTcl\lib\tclstub86.lib" WSock32.lib xpm\x86\lib-vc14\libXpm.lib /PDB:gvim.pdb -debug
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.![]()
Related: #4920
Have you tried using :let &shell syntax. This should make quoting easier. Try using an absolute path.
Hello,
I've tried :let &shell with every possibility I can come up with with no luck so far. Both with the environment variable and with an absolute path.
Other things to try:
:let &shell = substitute(expand('$PROGRAMW6432\Git\bin\bash.exe'), ' ', '^ ', 'g')
:let &shell = 'C:\Program^ Files\Git\bin\bash.exe'
:let &shell = 'C:\Program" "Files\Git\bin\bash.exe'
First reply went to the mailing list :-/
Hello,
Thank you for your suggestions. Unfortunately I tried all of them to no avail. None of them succeeded at creating a terminal inside vim with :term (CreateProcess failed).
Here are the screenshots corresponding to each one of them respectively when trying :!ls:
let &shell = substitute(expand('$PROGRAMW6432\Git\bin\bash.exe'), ' ', '^ ', 'g')
let &shell = 'C:\Program^ Files\Git\bin\bash.exe'
let &shell = 'C:\Program" "Files\Git\bin\bash.exe'
At least it's one step further: the error is reported from bash.exe.
Now bash sees Files\Git\bin\bash.exe as first argument, that's really weird.
How about this ugly workaround:
let &shell=fnamemodify(expand('$PROGRAMW6432\Git\bin\bash.exe'), ':8')
If you can build Vim by yourself, try #4920.
How about this ugly workaround:
let &shell=fnamemodify(expand('$PROGRAMW6432\Git\bin\bash.exe'), ':8')
Thank you for the suggestion. This seems to work. However, vundle's :PluginInstall is still broken, but that might of course be an issue on Vundle's side.
If you can build Vim by yourself, try #4920.
I have never done it before, but I will give it a try as soon as possible and give you an update.
Thanks everyone.
Closed #4950.
This should be fixed with 8.1.2115.