I sometimes have to work in Windows, which often means using the Bash shell. If I am (for example) in vim
(not gvim
) with several files open, and I hit CtrlZ to briefly go back to the shell and do something before returning to vim
, instead of suspending my vim
process Git Bash creates a new DOS shell. This is the last thing I'd ever want. Googling turns up nothing useful (at this point in time - YMMV in my future).
What is going on?
Make sure the "Quick Edit Mode" option is checked. If an "Experimental" tab shows up, select it and then make sure the top "Enable experimental console" and the "Enable new Ctrl key shortcuts" options are both checked. Click 'OK' to save. Now you can use Ctrl+V to paste.
If I am (for example) in vim (not gvim) with several files open, and I hit ^Z to briefly go back to the shell and do something before returning to vim, instead of suspending my vim process Git Bash creates a new DOS shell.
If you execute other processes in git bash, CTRL-Z won't suspend them either. Vim works around that and, instead, creates a shell to achieve a similar result. Vim is a tool in windows that doesn't require bash, rather the windows command prompt will be necessarily installed in a windows machine. I assume this is a safe choice of the windows binary program.
This is the last thing I'd ever want. Googling turns up nothing useful (at this point in time - YMMV in my future). What is going on?
My guess here is that vim has the CTRL-Z map to creating a DOS shell. If you want to create a bash shell instead, you can type:
:!sh
And you will be executing in a bash shell.
My guess that the reason for this is that Windows doesn't implement the POSIX suspend process API. I had the same issue and haven't found a general solution. But for specific common cases (such as gvim), a work around is to create a script somewhere in your PATH (e.g. /c/bin/gvim) along the lines of
#!/bin/env bash
/c/Program\ Files\ \(x86\)/Vim/vim73/gvim.exe $@ &
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With