From a Windows 7 Command Prompt:
ConEmu.exe /cmd "C:\Program Files\Git\bin\sh.exe" --login -i && exit
opens ConEmu (or a new tab therein) logged into Git Bash for the current directory, and (very quickly) exits the Command Prompt window, all good.
:silent !ConEmu.exe /cmd "C:\Program Files\Git\bin\sh.exe" --login -i
- if ConEmu was already running, opens a new tab logged into Git Bash for the buffer's directory, and exits the intermediary Command Prompt window, and returns me to my current buffer, all good.
- if ConEmu was not running, it's opened logged into Git Bash as above, but the intermediary Command Prompt window is left up in a seized state, requiring me to terminate it to unfreeze gVim. (Appending
$$ exitto the above gVim command doesn't help.)
The Question: How can I fix the 2nd gVim case, such that the Command Prompt window called by gVim closes automatically as in the 1st gVim case?
Supplementary gVim info (responding to @Maximus):
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 29 2014 07:03:32)
Process Start finds that this heirarchy of Commands, all labelled "(ConEmu.exe)", are triggered by
"C:\Program Files\vim\vim74\vimrun" C:\windows\system32\cmd.exe /c
C:\windows\system32\cmd.exe /c C:\windows\system32\cmd.exe /c
vimrun.exe is not in %PATH%.
Alternative attempt from gVim, using win32-!start:
if you enter a command like :!calc (to run calc.exe for the Windows calculator), Vim will open a shell window, then launch a new calc window from that shell. When calc is closed, the prompt Hit any key to close this window... appears, and Vim is frozen until a key is pressed. But Calculator is a GUI program so it runs in a new process, in a new window. So, if you want to asynchronously run a GUI program like Calculator, you can simply enter :!start calc
So I tried:
!start ConEmu.exe /cmd "C:\Program Files\Git\bin\sh.exe" --login -i && exit
- which doesn't seize gVim and opens a new ConEmu tab in Git at gVim's working directory, but fails to login, reporting
sh.exe": &&: No such file or directory, followed by:
Command to be executed: "C:\Program Files\Git\bin\sh.exe" --login -i && exit
ConEmuC: Root process was alive less than 10 sec, ExitCode=127.
Press Enter or Esc to close console...