Code

Reset terminal attributes when terminating git send-email
authorSean Estabrooks <seanlkml@sympatico.ca>
Fri, 17 Aug 2007 21:38:25 +0000 (17:38 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 22 Aug 2007 22:38:37 +0000 (15:38 -0700)
If you break out of the prompts presented to you by git send-email
your terminal can be left in an inconsistent state.  Here we trap
the interrupt signal and reset the terminal before exiting.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl

index 69559b289a28acf7fd095260797535f62db8172e..f1a88556824e098ab9594a6018e127c50c7fa51a 100755 (executable)
@@ -21,8 +21,11 @@ use warnings;
 use Term::ReadLine;
 use Getopt::Long;
 use Data::Dumper;
+use Term::ANSIColor;
 use Git;
 
+$SIG{INT} = sub { print color("reset"), "\n"; exit };
+
 package FakeTerm;
 sub new {
        my ($class, $reason) = @_;