[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A question about the INTR char
From: |
Thomas Dickey |
Subject: |
Re: A question about the INTR char |
Date: |
Thu, 23 Jan 2025 18:38:24 -0500 |
On Tue, Jan 21, 2025 at 08:25:03PM -0500, Dennis Clarke wrote:
>
> 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,
The Bitgraph terminal that I used in 1983-1984 had 65 lines.
When I used it to develop a font editor, I asked one of the people
in my department how I could use termcap to represent its graphical
escape sequences. He told me that termcap didn't do stuff like that.
https://invisible-island.net/personal/oldprogs.html#y1984
> > 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.
control-C is "just" the low-order 5 bits of the character.
c = 0x63
C = 0x43
(it doesn't make sense to people on StackOverflow who assume that every
character comes along with a list of modifiers).
> On just about any recent FreeBSD machine I can not see the CTRL-c chars at
> all. They simply do not appear :
I recall seeing some recent (month or two ago) comment on this,
with someone asking if it was an intentional change (and -- from memory)
that it was not intentional.
> 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?
It seems like a bug to me :-)
> 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?
probably not
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
signature.asc
Description: PGP signature