Re: [PATCH 2/2][Perlers?] git-send-email: SIG{TERM,INT} handlers
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 2, 2008, 21:31 UTC
- Message-ID
- <7vprvf11vv.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1201925161-9864-2-git-send-email-mfwitten@mit.edu>
Michael Witten <mfwitten@MIT.EDU> writes:
Show 25 quoted lines
> +# Handle Uncouth Termination
> +sub signal_handler{
> +
> + # Make text normal
> + print color("reset"), "\n";
> +
> + # SMTP password masked
> + system "stty echo";
> +
> + # tmp files from --compose
> + if (-e $compose_filename) {
> + print "'$compose_filename' contains an intermediate version of the email you were composing.\n";
> + }
> + if (-e ($compose_filename . ".final")) {
> + print "'$compose_filename.final' contains the composed email.\n"
> + }
> +
> + exit;
> +};
> +
> +$SIG{TERM} = \&signal_handler;
> +$SIG{INT} = \&signal_handler;
> +
> # Begin by accumulating all the variables (defined above), that we will end up
> # needing, first, from the command line:Now I think this patch (except the part about "stty echo") makes sense, although I did not try killing a send-email session with signals myself.
Success stories, people?