[comp.sources.d] erase key in NN

pim@ctisbv.UUCP (Pim Zandbergen) (07/19/89)

Normally, I use ^H as the erase key and DEL as the interrupt character.
NN, however, will not do erase processing when it prompts me for filenames,
newsgroups, etc. It will when I change the erase character to DEL
and the interrupt character to ^C.

Bug or feature?

NN 6.3 patchlevel 4 on an AT&T 3B2/600 running System V release 3.1.1.
-- 
--------------------+----------------------+-----------------------------------
Pim Zandbergen      | phone: +31 70 542302 | CTI Software BV
pim@ctisbv.UUCP     | fax  : +31 70 512837 | Laan Copes van Cattenburch 70
...!uunet!mcvax!hp4nl!ctisbv!pim           | 2585 GD The Hague, The Netherlands

dean@coplex.UUCP (Dean Brooks) (07/20/89)

pim@ctisbv.UUCP (Pim Zandbergen) writes:

>Normally, I use ^H as the erase key and DEL as the interrupt character.
>NN, however, will not do erase processing when it prompts me for filenames,
>newsgroups, etc. It will when I change the erase character to DEL
>and the interrupt character to ^C.

  We had the same problem with NN on our machine; in fact its the only
complaint I had about the entire package!  NN is a wonderful newsreader.

  Anyway, the one-line-fix below corrected the problem entirely for us.
Apparantely there was a problem with the CTRL-H key being trapped by the
key binding routines before it was identified as a back-space.

  Here is the fix.  The below one-line-fix is in "term.c", in the function
called "get_c()".  Simply add the one extra line.  It worked for us; we
are running UNIX 5.2 on Plexus hardware...  Hope it helps.

----
    
    while (--n >= 0) {
	c = *cp++;
#else    

    while ((n = read(0, &c, 1)) > 0) {
	c &= 0177;	/* done by ISTRIP on USG systems */
#endif
+	if (c == erase_key) goto got_char;  /* FIX for ERASE_KEY problem */
	
	any_multi = 0;
	for (i = multi_keys, mk = multi_key_list; --i >= 0; mk++)
	    if (mk->cur_key) {
----

dean@coplex.UUCP   Dean A. Brooks
                   Copper Electronics, Inc.
                   Louisville, Ky
UUCP: !mit-eddie!bloom-beacon!coplex!dean

storm@texas.dk (Kim F. Storm) (07/24/89)

dean@coplex.UUCP (Dean Brooks) writes:

>pim@ctisbv.UUCP (Pim Zandbergen) writes:

>>Normally, I use ^H as the erase key and DEL as the interrupt character.
>>NN, however, will not do erase processing when it prompts me for filenames,
>>newsgroups, etc. It will when I change the erase character to DEL
>>and the interrupt character to ^C.

>  We had the same problem with NN on our machine; in fact its the only
>complaint I had about the entire package!  NN is a wonderful newsreader.

>  Anyway, the one-line-fix below corrected the problem entirely for us.
>Apparantely there was a problem with the CTRL-H key being trapped by the
>key binding routines before it was identified as a back-space.

I just realized during the weekend, that this was indeed the reason
for the problems with the erase key on several systems: It was really
a problem on a few terminal types such as Wyse50, where the arrow keys
send single characters, and the left arrow key sends a back space!

This can be work-around without patching the code by the following map
command:

	map key left ^H

which will map the "misinterpreted" left arrow-key back into the erase key.

For some reason (another bug I suppose), the more obvious

	set erase-key left

does not work!
-- 
Kim F. Storm        storm@texas.dk        Tel +45 429 174 00
Texas Instruments, Marielundvej 46E, DK-2730 Herlev, Denmark
	  No news is good news, but nn is better!