I was slightly confused by:
% vim tmp
zsh: suspended vim tmp
% kill %1
% jobs
[1] + suspended vim tmp
% kill -SIGINT %1
% jobs
[1] + suspended vim tmp
% kill -INT %1
% jobs
[1] + suspended vim tmp
So I resigned to just "do it myself" and wonder why later:
% fg
[1] - continued vim tmp
Vim: Caught deadly signal TERM
Vim: Finished.
zsh: terminated vim tmp
%
Oh!
Makes sense really, now that I think about it, that vim
has to be running in order for it's signal handler to be told to quit, and to do so.
But obviously not what I intended.
Is there a way to "wake and quit" in a single command? i.e., a built-in alias for kill %N && fg %N
?
Why does resuming in the background not work? If I bg
instead of fg
, Vim stays alive until I fg
, which sort of breaks my above intuition.