[comp.unix.questions] Undefined erase/kill characters?

arndt@zyx.SE (Arndt Jonasson) (07/05/88)

The characters to use for erasing a single character and erasing an
entire line, commonly called 'erase' and 'kill' and readble/settable
by the 'stty' command, are stored in a character array pertaining to
the terminal driver, which is updated and read by the 'ioctl' requests
TCGETA/TCSETA/TCSETAF (in SysV) or TIOCGETP/TIOCSETN/TIOCSETP (in
BSD). My question is: can any character (from 0 to 255) be made to,
say, 'erase', or is there some value which indicates "undefined"?

I have looked in the Gnu Emacs source code and it uses the symbol CDEL
(which is #define'd to 0377 in <termio.h> on my system) to mean
undefined.  In HP-UX, however, that value is treated as any other,
i.e. Delete with parity erases the last character.

What do Unix systems normally do? Is there a standard for this
(meaning common usage, rather than prescription)? Do the SVID/SVVS
bother to specify this?

A related question: what is supposed to happen when more than one
characters in this array are set to the same value? Which function
is used when the terminal driver sees the character?
-- 
Arndt Jonasson, ZYX Sweden AB, Styrmansgatan 6, 114 54 Stockholm, Sweden
email address:	 arndt@zyx.SE	or	<backbone>!mcvax!enea!zyx!arndt

gallen@apollo.uucp (Gary Allen) (07/08/88)

In article <2652@zyx.SE> arndt@zyx.SE (Arndt Jonasson) writes:
>
>The characters to use for erasing a single character and erasing an
>entire line, commonly called 'erase' and 'kill' and readble/settable
>by the 'stty' command, are stored in a character array pertaining to
>the terminal driver, which is updated and read by the 'ioctl' requests
>TCGETA/TCSETA/TCSETAF (in SysV) or TIOCGETP/TIOCSETN/TIOCSETP (in
>BSD). My question is: can any character (from 0 to 255) be made to,
>say, 'erase', or is there some value which indicates "undefined"?

The BSD manual defines -1 to be "undefined".

>What do Unix systems normally do? Is there a standard for this
>(meaning common usage, rather than prescription)? Do the SVID/SVVS
>bother to specify this?

The only time that I've seen this done is when the port is being used
to talk to something other than a terminal, but line buffering is
still desired.

>A related question: what is supposed to happen when more than one
>characters in this array are set to the same value? Which function
>is used when the terminal driver sees the character?

The BSD manual says that this is "probably unwise".
>-- 
>Arndt Jonasson, ZYX Sweden AB, Styrmansgatan 6, 114 54 Stockholm, Sweden
>email address:	 arndt@zyx.SE	or	<backbone>!mcvax!enea!zyx!arndt

Gary Allen
Apollo Computer
Chelmsford, MA
{decvax,yale,umix}!apollo!gallen