ctrl-z in vim

887 views
Skip to first unread message

Cliff

unread,
Sep 28, 2011, 6:38:24 PM9/28/11
to mintty
I use the following command to start vim in a new mintty shell.
run mintty -e vim

Then if I do ctrl-z, I get dropped into a blank screen with no command
prompt. Also I cannot find a way to bring the vim process to
foreground. Normally, if you have a shell prompt available, command fg
would do it.

Not having the shell prompt isn't such a problem for me, but not being
able to get back does feel a bit annoying, as there is not a way to
close the process gracefully.

Is there a way to solve such problem?

Thanks
Cliff

Andy Koppe

unread,
Oct 1, 2011, 4:38:13 AM10/1/11
to mintty
You'd see the same thing in other terminal emulators, i.e. this isn't
a mintty issue.

Ctrl-Z suspends vim and drops you back to the invoking shell, but when
you invoke vim directly from the terminal there is no shell. Hence the
blank screen, and no command line to issue the fg command. What you
could do once you are in that situation is to open another window with
a shell and send a continue signal to the vim process, using 'kill -
CONT'.

If you do need a shell while in vim, you could use the :sh command to
invoke a new shell instead of trying to drop back to the non-existent
invoking shell.

Andy

Cliff

unread,
Oct 1, 2011, 6:54:12 PM10/1/11
to mintty
Nice tip! Thank you. I did not know about 'kill -CONT' or 'kill -
STOP'. It works quite well!
Reply all
Reply to author
Forward
0 new messages