NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/53245: wscons does not support SGR 39 49 or BEL as ST



>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:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue May 01 11:05:00 +0000 2018
>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.



Home | Main Index | Thread Index | Old Index