NetBSD Problem Report #42641

From dyoung@skyking.ojctech.com  Tue Jan 19 19:42:44 2010
Return-Path: <dyoung@skyking.ojctech.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 5553663BA2A
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 19 Jan 2010 19:42:44 +0000 (UTC)
Message-Id: <20100119194243.074D211214A5@skyking.ojctech.com>
Date: Tue, 19 Jan 2010 13:42:43 -0600 (CST)
From: dyoung@skyking.ojctech.com
Reply-To: dyoung@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: sh emacs-editing mode doesn't work
X-Send-Pr-Version: 3.95

>Number:         42641
>Category:       bin
>Synopsis:       sh emacs-editing mode doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 19 19:45:00 +0000 2010
>Closed-Date:    Sat May 05 18:05:38 +0000 2018
>Last-Modified:  Sat May 05 18:05:38 +0000 2018
>Originator:     David Young
>Release:        NetBSD 5.99.23
>Organization:
OJC Technologies
>Environment:
System: NetBSD skyking.ojctech.com 5.99.23 NetBSD 5.99.23 (GENERIC) #22: Mon Jan 18 20:13:15 CST 2010 dyoung@cuw.ojctech.com:/u5/dyoung-scratch/pristine/i386/O/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
ident /bin/sh:
     $NetBSD: crt0.c,v 1.17 2007/12/01 10:16:06 yamt Exp $
     $NetBSD: alias.c,v 1.12 2003/08/07 09:05:29 agc Exp $
     $NetBSD: cd.c,v 1.40 2010/01/01 19:34:59 dholland Exp $
     $NetBSD: echo.c,v 1.14 2008/10/12 01:40:37 dholland Exp $
     $NetBSD: error.c,v 1.37 2008/10/16 14:36:40 dholland Exp $
     $NetBSD: eval.c,v 1.98 2009/10/07 18:12:11 christos Exp $
     $NetBSD: exec.c,v 1.42 2008/10/16 15:31:05 dholland Exp $
     $NetBSD: expand.c,v 1.83 2009/11/27 10:50:04 tsutsui Exp $
     $NetBSD: histedit.c,v 1.41 2008/02/13 12:57:16 joerg Exp $
     $NetBSD: input.c,v 1.42 2009/03/10 21:21:11 roy Exp $
     $NetBSD: jobs.c,v 1.68 2008/12/21 17:16:11 christos Exp $
     $NetBSD: mail.c,v 1.16 2003/08/07 09:05:33 agc Exp $
     $NetBSD: main.c,v 1.53 2009/01/18 00:30:54 lukem Exp $
     $NetBSD: memalloc.c,v 1.29 2008/02/15 17:26:06 matt Exp $
     $NetBSD: miscbltin.c,v 1.38 2009/03/29 01:02:49 mrg Exp $
     $NetBSD: mystring.c,v 1.16 2003/08/07 09:05:35 agc Exp $
     $NetBSD: options.c,v 1.41 2009/01/18 00:30:54 lukem Exp $
     $NetBSD: parser.c,v 1.74 2009/01/18 00:30:54 lukem Exp $
     $NetBSD: redir.c,v 1.30 2008/01/21 06:43:03 msaitoh Exp $
     $NetBSD: show.c,v 1.26 2003/11/14 10:46:13 dsl Exp $
     $NetBSD: trap.c,v 1.34 2008/02/15 17:26:06 matt Exp $
     $NetBSD: output.c,v 1.31 2008/10/31 14:38:42 christos Exp $
     $NetBSD: var.c,v 1.39 2008/10/16 14:36:40 dholland Exp $
     $NetBSD: test.c,v 1.37 2008/09/10 19:00:51 christos Exp $
     $NetBSD: kill.c,v 1.26 2009/10/01 09:24:38 spz Exp $
     $NetBSD: syntax.c,v 1.2 2007/12/12 22:55:43 lukem Exp $
     $NetBSD: arith.y,v 1.19 2009/11/13 13:49:09 gson Exp $
     $NetBSD: arith_lex.l,v 1.15 2009/10/29 14:21:40 christos Exp $
     $NetBSD: printf.c,v 1.34 2009/10/13 19:28:31 christos Exp $
ldd /bin/sh:
	-lc.12 => /lib/libc.so.12
	-ltermcap.0 => /lib/libtermcap.so.0
	-ledit.3 => /lib/libedit.so.3
ident /lib/libedit.so.3:
     $NetBSD: readline.c,v 1.88 2010/01/03 18:27:10 christos Exp $
     $NetBSD: tokenizer.c,v 1.18 2010/01/03 18:27:10 christos Exp $
     $NetBSD: history.c,v 1.37 2010/01/03 18:27:10 christos Exp $
     $NetBSD: history.c,v 1.37 2010/01/03 18:27:10 christos Exp $
     $NetBSD: tokenizer.c,v 1.18 2010/01/03 18:27:10 christos Exp $
>Description:
sh(1) is not responding to Emacs key commands like it used to.
Commands ^P, ^N, and ^E do not do the right thing.

On a "fresh" command line, ^P does not recall the previous command
line.  Up-arrow does.  After I strike up-arrow, I can use ^P/^N do
move backward and forward in the command-line history.

On a command line recalled from history with up-arrow, ^E does not
move the cursor to the empty space blank after the last character
of the command line, like it used to, but moves it to the last
character, instead.

>How-To-Repeat:
Type:
	set -o emacs
	ls

See if Ctrl-P gives you the previous command.  (It will not.)  Try
Up Arrow.  It will work.  Now, type Ctrl-A followed immediately by
Ctrl-E.  Is the cursor on 's' or the blank after 's' ?  It ought
to be on the blank, but it will be on 's'.
>Fix:


>Release-Note:

>Audit-Trail:
From: "Michael L. Hitch" <mhitch@lightning.msu.montana.edu>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/42641: 
Date: Tue, 19 Jan 2010 13:25:10 -0700 (MST)

 On Tue, 19 Jan 2010, dyoung@skyking.ojctech.com wrote:

 > Type:
 > 	set -o emacs
 > 	ls
 >
 > See if Ctrl-P gives you the previous command.  (It will not.)  Try
 > Up Arrow.  It will work.  Now, type Ctrl-A followed immediately by
 > Ctrl-E.  Is the cursor on 's' or the blank after 's' ?  It ought
 > to be on the blank, but it will be on 's'.
 >> Fix:

    This would be due to the addition of a wrapper to convert to the new 
 wide-character version of libedit.  Libedit appears to default to using
 the vi edit mode, and the wrapper ignores any attempt to set the editor 
 mode using el_set(EL_EDITOR, "xxx").

    The following change adds EL_EDITOR back to el_set():

 Index: lib/libedit/eln.c
 ===================================================================
 RCS file: /cvsroot/src/lib/libedit/eln.c,v
 retrieving revision 1.4
 diff -u -p -r1.4 eln.c
 --- lib/libedit/eln.c	12 Jan 2010 19:40:50 -0000	1.4
 +++ lib/libedit/eln.c	16 Jan 2010 22:27:46 -0000
 @@ -118,6 +118,11 @@ el_set(EditLine *el, int op, ...)
   		ret = el_wset(el, op, va_arg(ap, char *));
   		break;

 +	case EL_EDITOR:
 +		ret = el_wset(el, op, ct_decode_string(va_arg(ap, char *),
 +		    &el->el_lgcyconv));
 +		break;
 +
   	case EL_SIGNAL:         /* int */
   	case EL_EDITMODE:
   	case EL_UNBUFFERED:

 --
 Michael L. Hitch			mhitch@montana.edu
 Computer Consultant
 Information Technology Center
 Montana State University	Bozeman, MT	USA

State-Changed-From-To: open->feedback
State-Changed-By: kre@NetBSD.org
State-Changed-When: Sun, 22 Apr 2018 03:48:16 +0000
State-Changed-Why:
This has been reported as fixed.   I am not an emacs user
so I really don't care...   But the change in the PR seems
to have been made to libedit sometime in the past.

Can you confirm that this is no longer an issue?


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/42641 (sh emacs-editing mode doesn't work)
Date: Fri, 27 Apr 2018 16:49:56 +0000

 On Sun, Apr 22, 2018 at 03:48:16AM +0000, kre@NetBSD.org wrote:
  > This has been reported as fixed.   I am not an emacs user
  > so I really don't care...   But the change in the PR seems
  > to have been made to libedit sometime in the past.
  > 
  > Can you confirm that this is no longer an issue?

 Works for me...

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: feedback->closed
State-Changed-By: kre@NetBSD.org
State-Changed-When: Sat, 05 May 2018 18:05:38 +0000
State-Changed-Why:
This seems to be fixed (christos added the patch in the
PR back in January 2010).


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.