NetBSD Problem Report #59977

From www@netbsd.org  Sun Feb  8 01:23:56 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "R13" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 51E341A923D
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  8 Feb 2026 01:23:56 +0000 (UTC)
Message-Id: <20260208012355.0A8321A923E@mollari.NetBSD.org>
Date: Sun,  8 Feb 2026 01:23:54 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: sh(1): input line editor sometimes blanks part of the input
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         59977
>Category:       bin
>Synopsis:       sh(1): input line editor sometimes blanks part of the input
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 08 01:25:00 +0000 2026
>Last-Modified:  Sun Feb 08 18:55:01 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, 9, ...
>Organization:
>Environment:
>Description:
Sometimes, when editing the middle of a line in sh(1), part of the rest of the line is blanked.  The text is still there under if I continue editing or redraw the screen, but it is displayed as blank.
>How-To-Repeat:
1. Type the following into the shell:

   $ quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland

2. Move the cursor to the start of the second `quagga' (`|' marks the cursor):

   $ quagga eland |quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland

3. Type `M-d' to delete that quagga:

   $ quagga eland | eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga eland

4. Type `quagga' to replace it -- as soon as I enter the second `a' in `quagga'; the input line reliably turns into:

   $ quagga eland quagga eland quagga eland quagga eland quagga eland quagga _eland quagga eland quagga eland quagga eland quagga eland quagga eland quagga_ eland quagga eland quagga eland quagga eland quagga eland quagga eland

   where the underscored part is displayed as blank in my terminal, but the text is still there under the hood, e.g. if I redraw the screen with C-l.
>Fix:
Yes, please!  This has been a problem as long as I can remember using NetBSD and it's really annoying!  I'm not sure whether it's an sh(1) bug, a libedit(3) bug, a kernel tty subsystem bug, or what.

>Audit-Trail:
From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: bin/59977: sh(1): input line editor sometimes blanks part of the input
Date: Mon, 09 Feb 2026 01:51:03 +0700

     Date:        Sun,  8 Feb 2026 01:25:00 +0000 (UTC)
     From:        "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>
     Message-ID:  <20260208012500.873701A923F@mollari.NetBSD.org>

   | I'm not sure whether it's an sh(1) bug, a libedit(3) bug,
   | a kernel tty subsystem bug, or what.

 That would be libedit(3) for sure.   Nothing else (relevant) allows
 moving around in the line other than just deleting from the end.

 kre

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.