]> git.ipfire.org Git - thirdparty/git.git/commit - editor.c
launch_editor: ignore terminal signals while editor has control
authorPaul Fox <pgf@foxharp.boston.ma.us>
Fri, 30 Nov 2012 22:41:26 +0000 (17:41 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Dec 2012 10:06:04 +0000 (02:06 -0800)
commit913ef36093eac3ec78b5fb155cc2beb5843b1ce5
tree6cf70b5b833f2aadd8c240aefa5afc470766f13f
parentf42ca31d8d209a43342ea345a52fc0bd43d71cc8
launch_editor: ignore terminal signals while editor has control

The user's editor likely catches SIGINT (ctrl-C).  but if
the user spawns a command from the editor and uses ctrl-C to
kill that command, the SIGINT will likely also kill git
itself (depending on the editor, this can leave the terminal
in an unusable state).

Let's ignore it while the editor is running, and do the same
for SIGQUIT, which many editors also ignore. This matches
the behavior if we were to use system(3) instead of
run-command.

Signed-off-by: Paul Fox <pgf@foxharp.boston.ma.us>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
editor.c