NetBSD Problem Report #37208

From jdwhite@menelos.com  Thu Oct 25 15:32:35 2007
Return-Path: <jdwhite@menelos.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id C3DC563BA4A
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 25 Oct 2007 15:32:35 +0000 (UTC)
Message-Id: <E1Il4hB-0004uq-8k@mail.menelos.com>
Date: Thu, 25 Oct 2007 10:32:29 -0500
From: jdw-pkgsrc@menelos.com
Reply-To:
To: gnats-bugs@NetBSD.org
Subject: editors/nano: input prompt cursor position problems using curses
X-Send-Pr-Version: 3.95

>Number:         37208
>Category:       pkg
>Synopsis:       physical cursor position does not update during prompt edits when using curses
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    obache
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 25 15:35:00 +0000 2007
>Closed-Date:    Fri Oct 26 16:46:01 +0000 2007
>Last-Modified:  Fri Oct 26 16:50:01 +0000 2007
>Originator:     Jason White
>Release:        NetBSD 3.1
>Organization:
Jason White <jdwhite@menelos.com>       Jabber: jdwhite(jabber.org)
http://jdwhite.menelos.com/                     jason.d.white(gmail.com)
PGP KeyID: 0x5290E477
>Environment:


System: NetBSD bender.menelos.com 3.1 NetBSD 3.1 (BENDER_XEN2_DOMU) #0: Sat Nov 18 20:00:43 CST 2006 root@smeghead:/usr/obj/i386/BENDER_XEN2_DOMU i386
Architecture: i386
Machine: i386
>Description:
When prompted for input, as when searching or saving, and you use any of the 
editing keys that would move the cursor around, the physical position does 
not update, but does logically.  I suspect this problem is similar to 
PR/37133 as this problem only occurs when using stock curses -- if compiled 
with ncursesw this problem does not exist.

>How-To-Repeat:
Bring up the search function. Type a few characters and then use the cursor 
keys to move left a few characters, then type some more.  The additional 
input will be inserted in the proper position, but the cursor will not 
change its position on screen moving it around and characters aren't being 
inserted or deleted.

>Fix:
Similar to PR/37133, it would appear the problem is that the prompt line 
needs to be refreshed after any cursor movements that don't result in the 
insertion or deletion of a character if stock curses is used.  The following 
patch forces the prompt line to be redrawn after each kbd input if ncurses 
isn't used.

--- src/prompt.c.orig   2007-10-25 04:28:18.000000000 -0500
+++ src/prompt.c        2007-10-25 10:26:12.000000000 -0500
@@ -916,10 +916,14 @@
  * different pages. */
 bool need_statusbar_horizontal_update(size_t pww_save)
 {
+#if defined(HAVE_NCURSES_H)
     size_t start_col = strlenpt(prompt) + 1;

     return get_statusbar_page_start(start_col, start_col + pww_save) !=
        get_statusbar_page_start(start_col, start_col + statusbar_pww);
+#else
+    return(1);
+#endif
 }

 /* Unconditionally redraw the entire screen, and then refresh it using

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->obache
Responsible-Changed-By: obache@netbsd.org
Responsible-Changed-When: Fri, 26 Oct 2007 13:35:06 +0000
Responsible-Changed-Why:
I take this too.


From: OBATA Akio <obache@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: jdw-pkgsrc@menelos.com
Subject: Re: pkg/37208: editors/nano: input prompt cursor position problems
 using curses
Date: Fri, 26 Oct 2007 22:49:54 +0900

 How about a following patch?

 $NetBSD$

 --- src/prompt.c.orig	2007-10-26 13:16:08.000000000 +0000
 +++ src/prompt.c
 @@ -1122,6 +1122,7 @@ int get_prompt_string(bool allow_tabs,
  #endif

  	reset_statusbar_cursor();
 +	wrefresh(bottomwin);
      }

  #ifndef NANO_TINY

 -- 
 "Of cource I love NetBSD":-)
 OBATA Akio / obache@NetBSD.org

From: Jason White <jdw-pkgsrc@menelos.com>
To: OBATA Akio <obache@NetBSD.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/37208: editors/nano: input prompt cursor position problems  using curses
Date: Fri, 26 Oct 2007 11:11:57 -0500

 On Fri, Oct 26, 2007 at 10:49PM +0900, OBATA Akio wrote:
 >How about a following patch?

 [patch removed]

   The patch fixes the problem.  Thank you.

 -- 
 Jason White <jdwhite@menelos.com>       Jabber: jdwhite(jabber.org)
 http://jdwhite.menelos.com/                     jason.d.white(gmail.com)
 PGP KeyID: 0x5290E477

State-Changed-From-To: open->closed
State-Changed-By: obache@netbsd.org
State-Changed-When: Fri, 26 Oct 2007 16:46:01 +0000
State-Changed-Why:
Fix was commited.  Thank you!


From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/37208 CVS commit: pkgsrc/editors/nano
Date: Fri, 26 Oct 2007 16:44:38 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Fri Oct 26 16:44:38 UTC 2007

 Modified Files:
 	pkgsrc/editors/nano: Makefile distinfo
 Added Files:
 	pkgsrc/editors/nano/patches: patch-ab

 Log Message:
 Fixes cursor update problem in prompt windows with NetBSD's curses,
 reported in PR 37208.

 Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -r1.29 -r1.30 pkgsrc/editors/nano/Makefile
 cvs rdiff -r1.12 -r1.13 pkgsrc/editors/nano/distinfo
 cvs rdiff -r0 -r1.1 pkgsrc/editors/nano/patches/patch-ab

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.