From nobody@FreeBSD.org  Wed Jan  3 19:52:45 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 88FC937B400
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  3 Jan 2001 19:52:45 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f043qjn19081;
	Wed, 3 Jan 2001 19:52:45 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200101040352.f043qjn19081@freefall.freebsd.org>
Date: Wed, 3 Jan 2001 19:52:45 -0800 (PST)
From: matt@photon.com
Sender: nobody@FreeBSD.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: /bin/stty ek doesnt work despite man page saying otherwise
X-Send-Pr-Version: www-1.0

>Number:         24063
>Category:       bin
>Synopsis:       /bin/stty ek doesnt work despite man page saying otherwise
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 03 20:00:01 PST 2001
>Closed-Date:    Thu Aug 23 15:31:13 PDT 2001
>Last-Modified:  Thu Aug 23 15:31:47 PDT 2001
>Originator:     Matt Wilbur
>Release:        4.2-RELEASE
>Organization:
Photon Research Associates
>Environment:
FreeBSD sublime 4.2-RELEASE FreeBSD 4.2-RELEASE #6: Sat Dec  2 13:41:20 PST 2000     matt@sublime:/usr/obj/usr/src/sys/SUBLIME  i386
>Description:
in migrating a bunch of irix users to a freebsd mail server, i had to sift through lots of old .cshrc/.login settings that were incompatible.  one such was stty ek.  i'm not sure whether this is a doc bug or a bin bug..  but the man page (of course, dated 1994...) says stty ek is valid, yet it looks like this:
EFS matt@sublime ~ > stty -g
gfmt1:cflag=4b00:iflag=2b02:lflag=200005cb:oflag=3:discard=f:dsusp=19:eof=4:eol=ff:eol2=ff:erase=7f:intr=3:kill=15:lnext=16:min=1:quit=1c:reprint=12:start=11:status=14:stop=13:susp=1a:time=0:werase=17:ispeed=9600:ospeed=9600
EFS matt@sublime ~ > stty ek
stty: illegal option -- ek
usage: stty [-a|-e|-g] [-f file] [options]

works fine as i typed it in solaris2.6/7/8, irix 6.x/5.x, rhat linux..
I couldn't find ek anywhere in /usr/src/bin/stty/key.c ... ?

the relevent man page snippet looks like this:

ek          Reset ERASE and KILL characters back to system defaults.


>How-To-Repeat:
'stty ek'

>Fix:
if backspace isn't working properly, 'stty erase <hit backspace>' works in a pinch.

>Release-Note:
>Audit-Trail:

From: Seth Kingsley <sethk@osd.bsdi.com>
To: freebsd-gnats-submit@FreeBSD.org, matt@photon.com
Cc:  
Subject: Re: bin/24063: /bin/stty ek doesnt work despite man page saying otherwise
Date: Wed, 14 Mar 2001 17:19:10 -0800

 It looks like this inconsistancy existed even in 4.4BSD-Lite. Where was
 this manual page stolen from? Regardless, here is a patch to add the
 described functionality:
 
 Index: key.c
 ===================================================================
 RCS file: /ncvs/src/bin/stty/key.c,v
 retrieving revision 1.11
 diff -u -r1.11 key.c
 --- key.c	1999/08/27 23:15:41	1.11
 +++ key.c	2001/03/15 00:47:10
 @@ -56,6 +56,7 @@
  void	f_cbreak __P((struct info *));
  void	f_columns __P((struct info *));
  void	f_dec __P((struct info *));
 +void	f_ek __P((struct info *));
  void	f_everything __P((struct info *));
  void	f_extproc __P((struct info *));
  void	f_ispeed __P((struct info *));
 @@ -82,6 +83,7 @@
  	{ "columns",	f_columns,	F_NEEDARG },
  	{ "cooked", 	f_sane,		0 },
  	{ "dec",	f_dec,		0 },
 +	{ "ek",		f_ek,		0 },
  	{ "everything",	f_everything,	0 },
  	{ "extproc",	f_extproc,	F_OFFOK },
  	{ "ispeed",	f_ispeed,	F_NEEDARG },
 @@ -179,6 +181,15 @@
  	ip->t.c_lflag &= ~ECHOPRT;
  	ip->t.c_lflag |= ECHOE|ECHOKE|ECHOCTL;
  	ip->t.c_iflag &= ~IXANY;
 +	ip->set = 1;
 +}
 +
 +void
 +f_ek(ip)
 +	struct info *ip;
 +{
 +	ip->t.c_cc[VERASE] = CERASE;
 +	ip->t.c_cc[VKILL] = CKILL;
  	ip->set = 1;
  }
  
 
 -- 
 || Seth Kingsley || BSDi/Open Source Division || sethk@osd.bsdi.com ||
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Thu Aug 23 15:31:13 PDT 2001 
State-Changed-Why:  
A fix has been applied to -current, and will be MFC'd after 4.4. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24063 
>Unformatted:
