From: Sean Estabrooks Date: Fri, 17 Aug 2007 21:38:25 +0000 (-0400) Subject: Reset terminal attributes when terminating git send-email X-Git-Tag: v1.5.3-rc7~38 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/412876dcbb7ca10e64ed8118bc1995788d397782 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 Signed-off-by: Junio C Hamano --- diff --git a/git-send-email.perl b/git-send-email.perl index 69559b289a..f1a8855682 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -21,8 +21,11 @@ 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) = @_;