@matheusbsbs / matheus-bagliano / commits / 412876dcbb
Fork 0

Reset terminal attributes when terminating git send-email

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>

Sean Estabrooks committed Aug 17, 2007 at 17:38 UTC 412876dcbb7ca10e64ed8118bc1995788d397782
1 file changed +3
git-send-email.perl
+3
@@ -21,8 +21,11 @@ use warnings;
21 use Term::ReadLine;
22 use Getopt::Long;
23 use Data::Dumper;
24 +use Term::ANSIColor;
25 use Git;
26
27 +$SIG{INT} = sub { print color("reset"), "\n"; exit };
28 +
29 package FakeTerm;
30 sub new {
31 my ($class, $reason) = @_;