NetBSD Problem Report #53245

From www@NetBSD.org  Tue May  1 11:03:47 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 1458D7A103
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  1 May 2018 11:03:47 +0000 (UTC)
Message-Id: <20180501110345.C4DB67A264@mollari.NetBSD.org>
Date: Tue,  1 May 2018 11:03:45 +0000 (UTC)
From: ds6@ds6.pw
Reply-To: ds6@ds6.pw
To: gnats-bugs@NetBSD.org
Subject: wscons does not support SGR 39 49 or BEL as ST
X-Send-Pr-Version: www-1.0

>Number:         53245
>Category:       kern
>Synopsis:       wscons does not support SGR 39 49 or BEL as ST
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue May 01 11:05:00 +0000 2018
>Closed-Date:    Mon Jun 28 16:24:49 +0000 2021
>Last-Modified:  Mon Jun 28 16:24:49 +0000 2021
>Originator:     ds6
>Release:        7.1.2
>Organization:
>Environment:
NetBSD 7.1.2 (GENERIC.201803151611Z)
>Description:
wscons does not appear to support some common ANSI escape sequences.
Specifically it does not recognize color reset (SGR 39 49, or
\e[39;49m) or xterm's BEL as ST (i.e. you must use \\ instead of \a in
shell scripts; ST is portable but BEL is more widely used, if going
against established specs).

While these features are of course not required for most system usage,
remoting into a machine that has a terminal using BEL instead of ST to
terminate OCT results in no more text being printed to the screen,
persisting for the lifetime of the console. Not recognizing color
resets can majorly mess up the readability of some shells that rely on
it, eg. using Zsh's PROMPT escape `%f' does not work at all.

Every other terminal emulator I have used supports these features,
even if not claiming compatibility with the device that spawned it.
It can be worked around locally but if a remote client you do not have
administrative control over is forcing you to use it or uses these
escapes in its default settings, it can be quite annoying.

It may be that there is a way to actually have this work but if so I
haven't found it.

>How-To-Repeat:
Try this in a shell

    echo "\e[30;47mhello \e[39;49mworld"

Expected output from this in most other terminal emulators is for
black text on white background for `hello' and for the color to be
reset for `world', but the color does not reset.

Equivalent in Zsh:

    print -P "\e[30;47mhello %fworld"


BELL as ST in OCT:

    echo "\e]0;in xterm this sets the term title properly\a"

Expected output is for the title to be set, but instead since wscons
is looking for a backslash it will eat all further characters until it
encounters one.  For those unfamiliar with terminals this can render
the it unusable, and a logout doesn't always fix it.

>Fix:
Check for either spec-correct ST or xterm's de facto BEL.  I am not
familiar with wscons implementation so I am not sure if this is easily
done, nor how to accomplish the other issue.

>Release-Note:

>Audit-Trail:
From: "Valeriy E. Ushakov" <uwe@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53245 CVS commit: src/sys/dev/wscons
Date: Tue, 5 Jun 2018 21:11:50 +0000

 Module Name:	src
 Committed By:	uwe
 Date:		Tue Jun  5 21:11:50 UTC 2018

 Modified Files:
 	src/sys/dev/wscons: wsemul_vt100_subr.c

 Log Message:
 PR kern/53245 - support SGR 39 (default foreground) and 49 (background).


 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 src/sys/dev/wscons/wsemul_vt100_subr.c

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

From: Rin Okuyama <rokuyama.rk@gmail.com>
To: "gnats-bugs@NetBSD.org" <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: kern/53245: wscons does not support SGR 39 49 or BEL as ST
Date: Tue, 8 Jun 2021 16:56:59 +0900

 -------- Forwarded Message --------
 Subject: CVS commit: src/sys/dev/wscons
 Date: Mon, 7 Jun 2021 11:52:08 -0400
 From: Christos Zoulas <christos@netbsd.org>
 Reply-To: source-changes-d@NetBSD.org
 To: source-changes-full@NetBSD.org

 Module Name:	src
 Committed By:	christos
 Date:		Mon Jun  7 15:52:08 UTC 2021

 Modified Files:
 	src/sys/dev/wscons: wsemul_vt100.c

 Log Message:
 PR/56223: David Shao ^[]8;;^G make console unresponsive. From OpenBSD:
 In `string' state, accept bell (^G) as an end of sequence in addition to
 `ESC \', as supported by xterm; some third-party software such as
 ncmpcpp rely upon this.


 To generate a diff of this commit:
 cvs rdiff -u -r1.46 -r1.47 src/sys/dev/wscons/wsemul_vt100.c

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


State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 09 Jun 2021 00:27:04 +0000
State-Changed-Why:
I think between the 2018 commit and the PR 56223 commit yesterday all
the issues in here are fixed; is that correct?


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 28 Jun 2021 16:24:49 +0000
State-Changed-Why:
Feedback mail bounced.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.