Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2019 13:08:57 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        "daichi@freebsd.org" <daichi@FreeBSD.org>, svn-src-head@freebsd.org, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: svn commit: r352558 - head/usr.bin/top
Message-ID:  <1BDFB387-930D-4F4D-8729-A5850F1C15B9@yahoo.com>
References:  <1BDFB387-930D-4F4D-8729-A5850F1C15B9.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Author: daichi
> Date: Fri Sep 20 17:37:23 2019
> New Revision: 352558
> URL: 
> https://svnweb.freebsd.org/changeset/base/352558
> 
> 
> Log:
>   top(1): support multibyte characters in command names (ARGV array)
>   depending on locale.
>   
>    - add setlocale()
>    - remove printable() function
>    - add VIS_OCTAL and VIS_SAFE to the flag of strvisx() to display
>      non-printable characters that do not use C-style backslash sequences
>      in three digit octal sequence, or remove it
>   
>   This change allows multibyte characters to be displayed according to
>   locale. If it is recognized as a non-display character according to the
>   locale, it is displayed in three digit octal sequence.
> 

Initially picking on tab characters as an example of what is
probably a somewhat broader issue . . .

Ever since this change, characters like tabs that do not fit
in the next character cell when output, but for which they
are !isprintable(...), now mess up the top display. Again
using tab as an example: line wrapping from the text having
been shifted over by more than one character cell. top does
not track the line wrapping result in how it decides what
to output for the following display updates.

As stands I type "hh" to referesh the display when I care
about clearing up the messy display.

The removed !isprintable handling functionality had its uses
and an alternative is needed for some types of characters if
the display is not to be messed up by what some command lines
that are echoed have in them.

I picked on tab because it was obviously involved in some
examples that I watched update. I'm not claiming tab is the
only character that ends up with e cursor in an unexpected
place now. In fact . . .

Looking around I found:

     VIS_SAFE	 Only encode "unsafe" characters.  Unsafe means control char-
		 acters which may cause common terminals to perform unexpected
		 functions.  Currently this form allows space, tab, newline,
		 backspace, bell, and return - in addition to all graphic
		 characters - unencoded.

So tab, newline, backspace, bell, and return are not encoded
or replaced now but do not have top's expected cursor position
result.


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1BDFB387-930D-4F4D-8729-A5850F1C15B9>