Debian Bug report logs - #131263
nvi fails to set application cursor keys and keypad keys

version graph

Package: libncurses5; Maintainer for libncurses5 is Craig Small <csmall@debian.org>; Source for libncurses5 is src:ncurses.

Reported by: David Härdeman <david@2gen.com>

Date: Mon, 28 Jan 2002 11:33:01 UTC

Severity: normal

Merged with 131718

Fixed in version ncurses/5.2.20020112a-4

Done: Daniel Jacobowitz <dan@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org:
Bug#131263; Package nvi. Full text and rfc822 format available.

Acknowledgement sent to David Härdeman <david@2gen.com>:
New Bug report received and forwarded. Copy sent to Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: David Härdeman <david@2gen.com>
To: submit@bugs.debian.org
Subject: nvi fails to set application cursor keys and keypad keys
Date: Mon, 28 Jan 2002 12:28:14 +0100
Package: nvi
Version: 1.79-20

I've discovered something which seems to be a bug in nvi.

When you start an xterm you can press "Ctrl + MiddleMouseButton" and get 
a menu that shows (among other things) if "Enable Application Cursor 
Keys" and "Enable Application Keymap Keys" is checked or not.

If I start elvis/vim/emacs/xemacs in xterm, those options become checked 
and the cursor keys just work. When I start nvi, they don't so when a 
cursor key is pressed, "Usage: [[" is shown at the bottom of the screen 
instead of the cursor moving. If I enable "Enable Application Cursor 
Keys" and "Enable Application Keymap Keys" manually in the xterm menu 
prior to starting nvi, it works just fine and disables them upon exit 
like any other well behaved editor, so obviously nvi knows about these 
options (since it can unset them).

So to be short, nvi should enable "Enable Application Cursor Keys" and 
"Enable Application Keymap Keys".

I hope I'm making some sense here, tell me if I'm not.

Regards,
David Härdeman




Information forwarded to debian-bugs-dist@lists.debian.org, Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org:
Bug#131263; Package nvi. Full text and rfc822 format available.

Acknowledgement sent to Steve Greenland <steveg@moregruel.net>:
Extra info received and forwarded to list. Copy sent to Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org. Full text and rfc822 format available.

Message #10 received at 131263@bugs.debian.org (full text, mbox):

From: Steve Greenland <steveg@moregruel.net>
To: David H?rdeman <david@2gen.com>, 131263@bugs.debian.org
Subject: Re: Bug#131263: nvi fails to set application cursor keys and keypad keys
Date: Mon, 28 Jan 2002 07:58:48 -0600
On 28-Jan-02, 05:28 (CST), David H?rdeman <david@2gen.com> wrote: 
> So to be short, nvi should enable "Enable Application Cursor Keys" and
> "Enable Application Keymap Keys".

I'll investigate this, but I suspect the issue is that doing so involves
manipulating one of Xterm's X resources. But you say that vim does it
right? Hmmm.

Steve



Information forwarded to debian-bugs-dist@lists.debian.org, Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org:
Bug#131263; Package nvi. Full text and rfc822 format available.

Acknowledgement sent to Steve Greenland <steveg@moregruel.net>:
Extra info received and forwarded to list. Copy sent to Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org. Full text and rfc822 format available.

Message #15 received at 131263@bugs.debian.org (full text, mbox):

From: Steve Greenland <steveg@moregruel.net>
To: David H?rdeman <david@2gen.com>, 131263@bugs.debian.org
Subject: Re: Bug#131263: nvi fails to set application cursor keys and keypad keys
Date: Mon, 28 Jan 2002 08:04:27 -0600
On 28-Jan-02, 05:28 (CST), David H?rdeman <david@2gen.com> wrote: 
> so obviously nvi knows about these 
> options (since it can unset them).

Obviously. Obviously I missed this in my previous reply. 

Or maybe not. It may well be that it's simply restoring the terminal to
its default state.

As I said, I'll investigate.

Steve



Information forwarded to debian-bugs-dist@lists.debian.org, Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org:
Bug#131263; Package nvi. Full text and rfc822 format available.

Acknowledgement sent to Sebastien Chaumontet <seb@snip.fr.eu.org>:
Extra info received and forwarded to list. Copy sent to Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org. Full text and rfc822 format available.

Message #20 received at 131263@bugs.debian.org (full text, mbox):

From: Sebastien Chaumontet <seb@snip.fr.eu.org>
To: 131263@bugs.debian.org
Subject: same bug without X
Date: Tue, 29 Jan 2002 12:39:00 +0100
 I have the same bug in a screen console without X.
 



Information forwarded to debian-bugs-dist@lists.debian.org, Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org:
Bug#131263; Package nvi. Full text and rfc822 format available.

Acknowledgement sent to Eirik Fuller <eirik@hackrat.com>:
Extra info received and forwarded to list. Copy sent to Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org. Full text and rfc822 format available.

Message #25 received at 131263@bugs.debian.org (full text, mbox):

From: Eirik Fuller <eirik@hackrat.com>
To: <131263@bugs.debian.org>
Subject: Re: Bug#131263: nvi fails to set application cursor keys and keypad keys
Date: Tue, 29 Jan 2002 03:49:09 -0800 (PST)
I believe this is a bug in the libncurses5 package.  Downgrading the
libncurses5 package to 5.2.20010318-3 should restore the correct
behavior.

Applying this patch to the ncurses-5.2.20020112a sources should also
solve the problem:


--- ncurses/tinfo/lib_options.c-	Wed Jan 16 19:13:57 2002
+++ ncurses/tinfo/lib_options.c	Mon Jan 28 13:44:02 2002
@@ -121,15 +121,15 @@
 NCURSES_EXPORT(int)
 keypad(WINDOW *win, bool flag)
 {
     T((T_CALLED("keypad(%p,%d)"), win, flag));
 
     if (win) {
 	win->_use_keypad = flag;
-	returnCode(OK);
+	returnCode(_nc_keypad(flag));
     } else
 	returnCode(ERR);
 }
 
 NCURSES_EXPORT(int)
 meta(WINDOW *win GCC_UNUSED, bool flag)
 {


I think the relevant entry from /usr/share/doc/libncurses5/changelog.gz
is this one:

20011215
	...
	+ corrected logic of keypad() by adding internal screen state to track
	  whether the terminal's keypad-mode has been set.  Use this in
	  wgetch() to update the keypad-mode according to whether the
	  associated window's keypad-mode has been set with keypad().  This
	  corrects a related problem restoring terminal state after handling
	  SIGTSTP (reported by Mike Castle).
	...

As I understand the patch described by that entry, it defers the
escape sequence ("\E[?1h" for xterm) which enables the keypad (the
smkx capability reported by "infocmp xterm") until the application
attempts to read characters from the terminal.  This approach doesn't
work in applications which use the ncurses keypad() function but do
not use the ncurses wgetch() function for input.  The patch above
combines the old behavior with the new behavior.

If you capture nvi output using the script command with xterm as the
terminal type, you'll see "\E[?1h" in the output with a version of
libncurses5 in which nvi's arrow keys work, but you won't see it with
the latest libncurses5.

It's not clear from the ncurses documentation whether the keypad
function is intended to work properly in applications which use their
own input routines, but nvi seems to depend on that, and it does work
in older versions of the ncurses library.  I suspect the dependence of
keypad() on wgetch() was an unintended side effect of the change for
handling SIGTSTP, and the patch above seems like the right fix.

Building nvi to use its own curses routines (omitting --disable-curses
in its configure script options) also solves the problem.



Information forwarded to debian-bugs-dist@lists.debian.org, Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org:
Bug#131263; Package nvi. Full text and rfc822 format available.

Acknowledgement sent to Steve Greenland <steveg@moregruel.net>:
Extra info received and forwarded to list. Copy sent to Steve Greenland <stevegr@debian.org>, nvi@packages.qa.debian.org. Full text and rfc822 format available.

Message #30 received at 131263@bugs.debian.org (full text, mbox):

From: Steve Greenland <steveg@moregruel.net>
To: Eirik Fuller <eirik@hackrat.com>, 131263@bugs.debian.org
Subject: Re: Bug#131263: nvi fails to set application cursor keys and keypad keys
Date: Tue, 29 Jan 2002 07:58:02 -0600
On 29-Jan-02, 05:49 (CST), Eirik Fuller <eirik@hackrat.com> wrote: 
> I believe this is a bug in the libncurses5 package.  Downgrading the
> libncurses5 package to 5.2.20010318-3 should restore the correct
> behavior.

Wow. Nice analysis, and thanks for the effort. I'll re-assign.

Steve




Bug reassigned from package `nvi' to `libncurses5'. Request was from Steve Greenland <steveg@moregruel.net> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Jacobowitz <ncurses-maint@debian.org>, ncurses@packages.qa.debian.org:
Bug#131263; Package libncurses5. Full text and rfc822 format available.

Acknowledgement sent to dickey@herndon4.his.com (Thomas Dickey):
Extra info received and forwarded to list. Copy sent to Daniel Jacobowitz <ncurses-maint@debian.org>, ncurses@packages.qa.debian.org. Full text and rfc822 format available.

Message #37 received at 131263@bugs.debian.org (full text, mbox):

From: dickey@herndon4.his.com (Thomas Dickey)
To: 131263@bugs.debian.org
Cc: dickey@herndon4.his.com (Thomas Dickey)
Subject: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=131263
Date: Sat, 2 Feb 2002 14:45:35 -0500
works for me, too.  it's in tonight's patch.

                       Debian Bug report logs - #131263
>           nvi fails to set application cursor keys and keypad keys
>
>   Package:  libncurses5;  Reported by: David =?ISO-8859-1?Q?H=E4rdeman?=
>   <david@2gen.com>;  dated Mon, 28 Jan 2002 11:33:01 UTC; Maintainer for
>   libncurses5 is Daniel Jacobowitz <ncurses-maint@debian.org>;
>   Source for libncurses5 is ncurses.
...
>--- ncurses/tinfo/lib_options.c-        Wed Jan 16 19:13:57 2002
>+++ ncurses/tinfo/lib_options.c Mon Jan 28 13:44:02 2002
>@@ -121,15 +121,15 @@
> NCURSES_EXPORT(int)
> keypad(WINDOW *win, bool flag)
> {
>     T((T_CALLED("keypad(%p,%d)"), win, flag));
>
>     if (win) {
>        win->_use_keypad = flag;
>-       returnCode(OK);
>+       returnCode(_nc_keypad(flag));
>     } else
>        returnCode(ERR);
> }
-- 
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net



Severity set to `normal'. Request was from Adam Lazur <zal@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Severity set to `important'. Request was from Adam Lazur <zal@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Bug reassigned from package `libncurses5' to `libncurses5'. Request was from Adam Lazur <zal@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Severity set to `normal'. Request was from Adam Lazur <zal@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Merged 131263 131718. Request was from Adam Lazur <zal@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Reply sent to Daniel Jacobowitz <dan@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to David Härdeman <david@2gen.com>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #52 received at 131263-close@bugs.debian.org (full text, mbox):

From: Daniel Jacobowitz <dan@debian.org>
To: 131263-close@bugs.debian.org
Subject: Bug#131263: fixed in ncurses 5.2.20020112a-4
Date: Mon, 18 Feb 2002 15:25:05 -0500
We believe that the bug you reported is fixed in the latest version of
ncurses, which has been installed in the Debian FTP archive:

libncurses5-dbg_5.2.20020112a-4_i386.deb
  to pool/main/n/ncurses/libncurses5-dbg_5.2.20020112a-4_i386.deb
libncurses5-dev_5.2.20020112a-4_i386.deb
  to pool/main/n/ncurses/libncurses5-dev_5.2.20020112a-4_i386.deb
libncurses5_5.2.20020112a-4_i386.deb
  to pool/main/n/ncurses/libncurses5_5.2.20020112a-4_i386.deb
libncursesw5-dbg_5.2.20020112a-4_i386.deb
  to pool/main/n/ncurses/libncursesw5-dbg_5.2.20020112a-4_i386.deb
libncursesw5-dev_5.2.20020112a-4_i386.deb
  to pool/main/n/ncurses/libncursesw5-dev_5.2.20020112a-4_i386.deb
libncursesw5_5.2.20020112a-4_i386.deb
  to pool/main/n/ncurses/libncursesw5_5.2.20020112a-4_i386.deb
ncurses-base_5.2.20020112a-4_all.deb
  to pool/main/n/ncurses/ncurses-base_5.2.20020112a-4_all.deb
ncurses-bin_5.2.20020112a-4_i386.deb
  to pool/main/n/ncurses/ncurses-bin_5.2.20020112a-4_i386.deb
ncurses-term_5.2.20020112a-4_all.deb
  to pool/main/n/ncurses/ncurses-term_5.2.20020112a-4_all.deb
ncurses_5.2.20020112a-4.diff.gz
  to pool/main/n/ncurses/ncurses_5.2.20020112a-4.diff.gz
ncurses_5.2.20020112a-4.dsc
  to pool/main/n/ncurses/ncurses_5.2.20020112a-4.dsc



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 131263@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Jacobowitz <dan@debian.org> (supplier of updated ncurses package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 17 Feb 2002 18:57:56 -0500
Source: ncurses
Binary: libncurses5 libncurses5-dev ncurses-base libncursesw5-dbg libncurses5-dbg libncursesw5-dev ncurses-bin ncurses-term libncursesw5
Architecture: source i386 all
Version: 5.2.20020112a-4
Distribution: unstable
Urgency: low
Maintainer: Daniel Jacobowitz <ncurses-maint@debian.org>
Changed-By: Daniel Jacobowitz <dan@debian.org>
Description: 
 libncurses5 - Shared libraries for terminal handling
 libncurses5-dbg - Debugging/profiling libraries for ncurses
 libncurses5-dev - Developer's libraries and docs for ncurses
 libncursesw5 - Shared libraries for terminal handling (wide character support)
 libncursesw5-dbg - Debugging/profiling libraries for ncurses
 libncursesw5-dev - Developer's libraries and docs for ncursesw
 ncurses-base - Descriptions of common terminal types
 ncurses-bin - Terminal-related programs and man pages
 ncurses-term - Additional terminal type definitions
Closes: 53776 55091 71637 89034 98029 99493 107453 107897 116943 119491 130029 131263 131501 132037 134205
Changes: 
 ncurses (5.2.20020112a-4) unstable; urgency=low
 .
   * Give all packages a common doc directory via symlinks.
   * Add a FAQ.
     - Document Print Screen on the console sending SIGQUIT
       (Closes: #53776).
     - Document ncurses applications resetting custom cursors
       (Closes: #55091).
     - Document the situation with Home and End
       (Closes: #131501, #89034, #98029, #107453, #107897, #116943,
        #119491, #130029, #99493).
     - Document the use of different xterms and xterm terminal types
       (Closes: #71637).
   * Include patch from Sven Verdoolaege to fix some wide-character
     bugs (Closes: #134205).
   * Include patch to fix keypad() bug (Closes: #131263).
   * Fix typo in keybound.3x manpage (Closes: #132037).
Files: 
 1bf9941f5a4b85b8af91e039baa3fed6 771 libs standard ncurses_5.2.20020112a-4.dsc
 94ad4e458d55af8b17adf38d5a8b49b7 26835 libs standard ncurses_5.2.20020112a-4.diff.gz
 061f588ef48f76441d0295d4c00e5c5b 238960 base required libncurses5_5.2.20020112a-4_i386.deb
 fbccd8aa2b957d7d5eba09a85e0e1d5b 998288 devel optional libncurses5-dev_5.2.20020112a-4_i386.deb
 d20c2e5761627e80d5e72feab0b737f3 299890 devel extra libncurses5-dbg_5.2.20020112a-4_i386.deb
 20c0c42d9eaa04dec5c1022c704f2720 244848 libs optional libncursesw5_5.2.20020112a-4_i386.deb
 88f3cc494649e8d3dc7d7ed88f0e13d7 376530 devel optional libncursesw5-dev_5.2.20020112a-4_i386.deb
 957cb7c85ce4f08fd6f8eac0723b044c 311492 devel extra libncursesw5-dbg_5.2.20020112a-4_i386.deb
 1093f092dfab52a3f12933de62c32a1c 190430 base required ncurses-bin_5.2.20020112a-4_i386.deb
 569dda777a12005fdc771aa1c13d7f1b 9048 base required ncurses-base_5.2.20020112a-4_all.deb
 f0e21821dfe4e03fee28415b21dca5bd 400882 admin standard ncurses-term_5.2.20020112a-4_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8cEl6bgOPXuCjg3cRAhubAJ9Gg3dJ8t/rSAXkKy9pmkPVC3HYdwCfVovw
RxFN25UZLCipcxzZI8m9koE=
=sc72
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 19:15:27 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.