bug-ncurses
[Top][All Lists]
Advanced

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

A question about the INTR char


From: Dennis Clarke
Subject: A question about the INTR char
Date: Tue, 21 Jan 2025 20:25:03 -0500
User-agent: Mozilla Thunderbird


Firstly : I apologize for quoting content from an email titled "CTRL-L
 Clear Screen" from sometime last year. I have been pouring over the man
 pages for stty trying to figure out something that should be trivial.
 However it seems to escape me. No pun intended. This is not a bug in
 anything other than strange behavior I am seeing on FreeBSD.


On 6/23/24 05:25, Thomas Dickey wrote:
On Sun, Jun 23, 2024 at 03:19:57AM -0400, Steve Litt wrote:
Thomas Dickey said on Sat, 22 Jun 2024 17:19:54 -0400

On Fri, Jun 21, 2024 at 07:01:44AM +1000, Michael D. Setzer II wrote:

Just wondering if the Ctrl-L would clean screen?

A few terminals (mostly emulators actually) will clear the screen on
^L. DEC's hardware terminals were not among those; xterm likewise.

I don't know if this is relevant to this discussion, but when I

.
. < snip some great stuff from long ago when we had paper terminals >
.
.
Terminal emulators can of course have lots of sizes, and it's been that
way a while.  This one dates back to the 1980s:

x10term|vs100-x10|xterm terminal emulator (X10 window system),
        OTbs, am, km, mir, msgr, xenl, xon,
        cols#80, it#8, lines#65,
        bold=\E[1m, clear=\E[H\E[2J, csr=\E[%i%p1%d;%p2%dr,
        cub1=^H, cud1=\n, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
        cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, ed=\E[J, el=\E[K,
        home=\E[H, ht=^I, ind=\n, is2=\E\E[m\E[?7h\E[?1;4l, kbs=^H,
        kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP,
        kf2=\EOQ, kf3=\EOR, kf4=\EOS, rev=\E[7m, ri=\EM, rmam=\E[?7l,
        rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
        sgr0=\E[m, smam=\E[?7h, smir=\E[4h, smkx=\E[?1h\E=,
        smso=\E[7m, smul=\E[4m, use=ansi+idl,


Here is where I need to ask why a terminal would display the chars "^C"
when a user hits the INTR key sequence as described in the stty settings
at the time? Here is an example from an old Solaris server :

hubble $ uname -a
SunOS hubble 5.10 Generic_150400-67 sun4u sparc SUNW,SPARC-Enterprise
hubble $
hubble $ stty -a
speed 38400 baud;
rows = 32; columns = 96; ypixels = 776; xpixels = 1175;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = -^?; eol2 = -^?; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk crtscts -crtsxoff -parext
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff -imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
hubble $
hubble $ ls -la /var/^C
hubble $

There you see that I began to type the command "ls -la /var/" and then hit the CTRL - c sequence. Here I am careful to say lowercase "c" but I can tell you that holding the SHIFT key and then CTRL - C uppercase works the same. Above we see that "intr = ^c" and so this all makes perfect sense.

On just about any recent FreeBSD machine I can not see the CTRL-c chars at all. They simply do not appear :

titan$
titan$ uname -apKU
FreeBSD titan 15.0-CURRENT FreeBSD 15.0-CURRENT #6 main-n274871-4f4b2b7a4b6c-dirty: Mon Jan 20 19:41:08 GMT 2025 root@titan:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 amd64 1500030 1500030
titan$
titan$ stty -a
speed 38400 baud; 28 rows; 120 columns;
lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
        -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff -ixany -imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk iutf8
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
        -dtrflow -mdmbuf rtsdtr
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
        lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
        status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;
titan$
titan$ ls -la /var/
titan$

Well I assure you that I did hit the CTRL-c in the same manner and
indeed the INTR char must have been accepted and processed because
the input stopped and a newline was output to give me the next prompt.

However the "^C" is missing. Invisible. One can not see it at all.

So I have to wonder if this is a shell problem with /bin/sh on all
recent FreeBSD versions or simply a nifty terminal config?

I can even set the terminal to "dumb" and this has no effect.

titan$
titan$ TERM=dumb ; export TERM
titan$
titan$ stty ispeed 1200
titan$ stty ospeed 1200
titan$
titan$ stty -a
speed 1200 baud; 28 rows; 120 columns;
lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
        -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff -ixany -imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk iutf8
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
        -dtrflow -mdmbuf rtsdtr
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
        lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
        status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;
titan$
titan$ ls -la /var/
titan$

Well at least the baud rate changed but the INTR char sequence is invisible. Is there a way to manage this with stty/terminal config?

--
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken




reply via email to

[Prev in Thread] Current Thread [Next in Thread]