public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Peterson <joe@skyrush.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] echo ctrl characters on INTR/QUIT/SUSP
Date: Tue, 04 Dec 2007 07:19:19 -0700	[thread overview]
Message-ID: <475561E7.80304@skyrush.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

The stty setting, "echoctl", directs the tty to echo control characters
as a normal letter prefixed by "^" (such as "^C" for the default INTR
setting).  Linux does not currently echo for the INTR/QUIT/SUSP signals,
whereas all other "unix" variants I have used over the years do, to my
recollection anyway (I recently tested: Solaris, BSD, Mac OS X).  I find
this a really nice feature, since it becomes very clear at a glance that
a terminal process was interrupted explicitly rather than finishing
normally (when I am running many things in different windows, it's nice
to verify which ones I interrupted).  It's just nice to see that echo
for positive feedback, and it seems to be standard OS behavior.

If you try this patch and don't see the echo, make sure echoctl is on
("stty echoctl").  I have applied this patch to 2.6.22 in my tests.  I
welcome feedback, as I have not seen this issue addressed before.
Please cc me at my address above on replies.

					Thanks, Joe


[-- Attachment #2: gentoo-sources-2.6.22-echoctl.patch --]
[-- Type: text/plain, Size: 336 bytes --]

--- linux-2.6.22-gentoo-r9.old/drivers/char/n_tty.c	2007-12-03 16:25:05.000000000 -0700
+++ linux-2.6.22-gentoo-r9/drivers/char/n_tty.c	2007-12-03 21:58:44.000000000 -0700
@@ -761,6 +761,9 @@
 		if (c == SUSP_CHAR(tty)) {
 send_signal:
 			isig(signal, tty, 0);
+			if (L_ECHO(tty)) {
+				echo_char(c, tty);
+			}
 			return;
 		}
 	}

                 reply	other threads:[~2007-12-04 14:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=475561E7.80304@skyrush.com \
    --to=joe@skyrush.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox