From: brian m. carlson Date: Fri, 21 Feb 2020 02:25:58 GMT Subject: Re: git does not wait on hook exes (^C) Message-ID: <20200221022558.GD6462@camp.crustytoothpaste.net> In-Reply-To: On 2020-02-21 at 01:20:51, Anthony Sottile wrote: > My hook in question is a python process: https://pre-commit.com > > It doesn't really do all that much on SIGINT but prints "(^C) > Interrupted" and offers a crash log when receiving ^C -- this races > with the git process terminating and causes terminal spew (sometimes > with pretty bad consequences with input breaking until `reset` > depending on which thing wins the tty reset race). Thanks, this is helpful context. I don't know that Git waiting for the process is going to fix the broken terminal state, although it will likely fix the jumbled output. I'm not planning on writing a patch, but I think an interesting patch to see might be if we called wait(2) in a loop in a SIGINT handler but didn't reinstall the signal handler, which means that a second Ctrl-C would kill Git. I believe that's what certain other programs do, and that might address many of the problems in both scenarios. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204