NetBSD Problem Report #39175

From gson@gson.org  Sun Jul 20 18:54:05 2008
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id EEE0263BD15
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 20 Jul 2008 18:54:04 +0000 (UTC)
Message-Id: <20080720185401.5442D761A8@guava.gson.org>
Date: Sun, 20 Jul 2008 21:54:01 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@gnats.NetBSD.org
Subject: Curses regression causes disoptimal and confusing output
X-Send-Pr-Version: 3.95

>Number:         39175
>Category:       lib
>Synopsis:       Curses regression causes disoptimal and confusing output
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 20 18:55:00 +0000 2008
>Closed-Date:    Tue Aug 19 08:16:51 +0000 2008
>Last-Modified:  Tue Aug 19 08:16:51 +0000 2008
>Originator:     Andreas Gustafsson
>Release:        NetBSD 4.99.69 (-current source date 2008.07.04.15.51.35)
>Organization:
>Environment:
System: NetBSD 4.99.69
Architecture: i386
Machine: i386
>Description:

When running sysinst from -current source date 2008.07.04.15.51.35
(UTC) or newer, the sysinst output uses ANSI terminal escape
sequences in wasteful and confusing ways.  For example, where earlier
versions would output

  Welcome to sysinst, the NetBSD-4.99.69 system installation tool.

sysinst will now output

  Welcome^[[Cto^[[Csysinst,^[[Cthe^[[CNetBSD-4.99.69^[[Csystem^[[Cinstallation^[[Ctool.

where ^[[C is the ANSI terminal escape sequence for "move cursor
right".  Although this will render correctly on the ANSI terminal, it
is inefficient as it generates three bytes of output where a single
ASCII space would do.  It also makes the output harder to read or
screen-scrape for purposes of debugging or automated testing (the
latter is how I ran into the problem).

The problem is not limited to space characters as in the above
example; any character that happens to be identical to the prior
screen contents will be replaced by a "move cursor right" sequence.
For example, instead of

  Please enter a name for your NetBSD disk

sysinst will now output

  Please^[[Cent^[[Cr a name for your NetBSD d^[[Csk

replacing the letter "e" with a "move cursor right" sequence in two
places.

I assume other curses-based applications are similarly affected.

I have narrowed down the appearance of the problem to the
a specific commit: src/lib/libcurses/cr_put.c revision 1.25 -> 1.26.

>How-To-Repeat:

Run sysinst in an emulator using an emulated serial console and
capture the output.  Presumably you can also run some other
curses application and/or capture the output using "script",
but I haven't tried that myself.

>Fix:

Perhaps the commit identified above can be reverted.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Tue, 19 Aug 2008 08:16:51 +0000
State-Changed-Why:
The workaround committed by tnozaki in cr_put.c revision 1.27
fixes the problem for me.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.