The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* stty erase '^?' in v7
@ 2017-10-14  2:59 Will Senn
  2017-10-14  4:08 ` Grant Taylor
  2017-10-14  4:39 ` Random832
  0 siblings, 2 replies; 15+ messages in thread
From: Will Senn @ 2017-10-14  2:59 UTC (permalink / raw)


Does anyone know why stty won't accept '^?' in v7? It will accept '^h', 
but then the shell expects ^h to "backspace". I am trying to get the 
delete key on my mac to do the backing up and it's '^?'. # isn't my 
favorite since it's used in C programs, but pressing CTRL-h to backup is 
a pain too. If you've read this far, I have three more questions:

1. How do you escape # in order to write a C program if # is the erase 
character in the terminal?
2. How do you enter a literal character in the v7 shell (I am used to 
CTRL-v CTRL-DEL to enter the delete character on other unices)?
3. Is there a way to echo the ascii value of a keypress in v7?

Thanks,

Will

-- 
GPG Fingerprint: 68F4 B3BD 1730 555A 4462  7D45 3EAA 5B6D A982 BAAF



^ permalink raw reply	[flat|nested] 15+ messages in thread
* stty erase '^?' in v7
@ 2017-10-14  4:25 Noel Chiappa
  2017-10-14  4:48 ` Will Senn
  2017-10-14  6:31 ` Dave Horsfall
  0 siblings, 2 replies; 15+ messages in thread
From: Noel Chiappa @ 2017-10-14  4:25 UTC (permalink / raw)


    > From: Will Senn

    > 1. How do you escape # in order to write a C program if # is the erase 
    > character in the terminal?

"Use the source, Luke!" V7 is simple enough that it's pretty quick to find
the answers to things like this. E.g.

  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/sys/dev/tty.c>

will answer this question (in "canon()").

    > 3. Is there a way to echo the ascii value of a keypress in v7?

A quick look through tty.c suggests this doesn't exist in V7 - without running
a user program that puts the TTY in 'raw' mode and prints out what it
sees. Not sure if there is one off the rack, or if you'd have to whip up a
20-line program to do it.

       Noel


^ permalink raw reply	[flat|nested] 15+ messages in thread
* stty erase '^?' in v7
@ 2017-10-14 12:52 Noel Chiappa
  2017-10-14 14:40 ` Clem Cole
  0 siblings, 1 reply; 15+ messages in thread
From: Noel Chiappa @ 2017-10-14 12:52 UTC (permalink / raw)


    > From: Will Senn

    > I didn't know that the delete key served a purpose, interrupt

At MIT, the PWB1 (effectively) system that was standard at Tech Sq had had its
teletype driver completely re-written by the time I started using it, and that
was changed, so I never saw this IRL.

Recently, I needed a Unix to run under Ersatz-11, to talk to physical QBUS
-11's and download them over their console line, so I went with V6 (since I
had not at that point managed to recover the MIT system). Wow. Talk about
a rude awakening!

That was one of the things that was, ah, problematic - and in V6, there's no
way to change the interrupt character. (And no, I didn't feel like switching
to a later version!)

An even bigger problem was that in vanilla V6, there's _no way_ to do 8-bit
input _and_ output. Sheesh. I managed to fix that too, after a certain amount
of pain. (I missed a code path, or something like that, and it took me quite a
while to figure out why my fixes didn't work.)

    Noel


^ permalink raw reply	[flat|nested] 15+ messages in thread
* stty erase '^?' in v7
@ 2017-10-15 14:39 Noel Chiappa
  0 siblings, 0 replies; 15+ messages in thread
From: Noel Chiappa @ 2017-10-15 14:39 UTC (permalink / raw)


    > From: Will Senn

    > All that cooked and raw stuff is gobbledegook that I'll have to read up
    > on.

The raw/cooked stuff isn't the source of the worst hair in the TTY driver;
that would be delays (on the output side), and delimiter processing (on the
input side).

The delays are for mechanical terminals, because they need delays after a
motion command (e.g. NL, CR, etc) before the next printing character is sent;
differing for different motion control commands, further complexified by the
current print head position - a Carriage Return from column 70 taking a lot
longer than one from column 10. The driver keeps track of the current column,
so it can calculate this! It does the delays by putting in the output queue a
chacter with the high bit set, and the delay in the low bits; the output start
routine looks for these, and does the delay.

On the input side, every time it sees a delimiter (NL, EOF), it inserts a 0xFF
byte in the input queue, and increments a counter to keep track of how many it
has inserted. I _think_ this is so that any given read call on a 'cooked'
terminal will return at most one line of input (although I don't know why they
don't just parse the buffer contents at read time - although I guess they need
the delimiter count so the read call will wait if there is not a complete line
there yet).

I should look and see how the MIT TTY driver (which also supported 8-bit input
and output) dealt with these...

    Noel


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-10-16 14:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-14  2:59 stty erase '^?' in v7 Will Senn
2017-10-14  4:08 ` Grant Taylor
2017-10-14  4:39 ` Random832
2017-10-14  5:03   ` Will Senn
2017-10-16 14:46     ` Random832
2017-10-14  4:25 Noel Chiappa
2017-10-14  4:48 ` Will Senn
2017-10-14  6:31 ` Dave Horsfall
2017-10-14 14:03   ` Will Senn
2017-10-14 22:01     ` Dave Horsfall
2017-10-14 12:52 Noel Chiappa
2017-10-14 14:40 ` Clem Cole
2017-10-14 14:44   ` Ronald Natalie
2017-10-15 13:10     ` Don Hopkins
2017-10-15 14:39 Noel Chiappa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).