Thread (2 messages) flat view 2 messages, 1 author, 2016-06-15
DORMANTno replies

[PATCH] Reset terminal attributes when terminating git send-email

From: Sean Estabrooks <hidden>
Date: 2016-06-15 22:43:29
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 git-send-email.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 69559b2..f1a8855 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -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) = @_;
-- 
1.5.3.rc5.18.gcb57
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help