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

4 messages from 2007-08-17 to 2007-08-17. Participants: Sean Estabrooks, Junio C Hamano, Sean.
Thread: https://gitlist.dev/t/9566

## Sean Estabrooks, 2007-08-17 21:38

Subject: [PATCH] Fix small typo in git send-email man page.
Message-ID: <11873867051906-git-send-email-seanlkml@sympatico.ca>
URL: https://gitlist.dev/e/11873867051906-git-send-email-seanlkml%40sympatico.ca

```
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
---
 Documentation/git-send-email.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index d243ed1..08a023e 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -62,7 +62,7 @@ The --cc option must be repeated for each user you want on the cc list.
 --signed-off-by-cc, --no-signed-off-by-cc::
         If this is set, add emails found in Signed-off-by: or Cc: lines to the
         cc list.
-        Default is the value of 'sendemail.signedoffbycc' configuration value;
+        Default is the value of 'sendemail.signedoffcc' configuration value;
         if that is unspecified, default to --signed-off-by-cc.
 
 --quiet::
-- 
1.5.3.rc5.18.gcb57

```

## Sean Estabrooks, 2007-08-17 21:38

Subject: [PATCH] Reset terminal attributes when terminating git send-email
Message-ID: <11873867051589-git-send-email-seanlkml@sympatico.ca>
URL: https://gitlist.dev/e/11873867051589-git-send-email-seanlkml%40sympatico.ca
In-Reply-To: <11873867051906-git-send-email-seanlkml@sympatico.ca>

```
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>
---
 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

```

## Junio C Hamano, 2007-08-17 22:19

Subject: Re: [PATCH] Reset terminal attributes when terminating git send-email
Message-ID: <7vr6m1g5y4.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vr6m1g5y4.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <11873867051589-git-send-email-seanlkml@sympatico.ca>

```
Sean Estabrooks <seanlkml@sympatico.ca> writes:

> 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>
> ---
>  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) = @_;

I wonder if this is something Term::ReadLine when not using
FakeTerm should and does provide...  Is this the standard
workaround all the applications that use Term::ReadLine need to
implement themselves?

```

## Sean, 2007-08-17 22:35

Subject: Re: [PATCH] Reset terminal attributes when terminating git send-email
Message-ID: <20070817183544.f2897cb3.seanlkml@sympatico.ca>
URL: https://gitlist.dev/e/20070817183544.f2897cb3.seanlkml%40sympatico.ca
In-Reply-To: <7vr6m1g5y4.fsf@gitster.siamese.dyndns.org>

```
On Fri, 17 Aug 2007 15:19:15 -0700
Junio C Hamano <gitster@pobox.com> wrote:

> I wonder if this is something Term::ReadLine when not using
> FakeTerm should and does provide...  Is this the standard
> workaround all the applications that use Term::ReadLine need to
> implement themselves?

Unfortunately Term::ReadLine (at least here with perl 5.8.8) does
not properly reset the terminal even when used in a test script
without FakeTerm.   I don't know anything about perl and couldn't
turn up any answers to this problem with Google, but maybe there
is still a better solution known.  It would sure be much nicer if
ReadLine just took care of this detail itself.

Sean

```
