[PATCH] echo ctrl characters on INTR/QUIT/SUSP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--- 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;
 		}
 	}

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux