On 4/17/26 4:33 PM, Alan Mackenzie wrote:
I can't reproduce this using macOS Terminal, which correctly displays the Unicode character. I imagine your terminal will, too, when you're finished.I see the bug only when a full-width character is straddling a line break. Is the UMBRELLA WITH RAIN DROPS a full-width character on your Mac? Another character I've used for this is U+ff11, FULLWIDTH DIGIT ONE.
Its glyph consumes two physical screen columns, which is consistent with what wcwidth(3) returns.
From (v), when I attempt to type in a character with cursor on the spurious space, it inserts itself _before_ the preceding character "c", though this only becomes visible on deleting stuff near BOL to move the full-width char away from the line break.
I simply do not get the same results on macOS. I'm mostly interested in the
case where wcwidth(3) and the terminal's character display are consistent.
What readline does in this case is to get the number of columns required to
display a character using wcwidth(3), calculate the number of screen
columns remaining before the line wraps to the next, and leave blanks at
the end of the previous line if there are not enough physical columns to
display the entire multibyte character.
So if the umbrella is the first character on the second line, and the
preceding character is a single-byte character, readline will leave a
single blank column at the end of the first line because there is not
enough room to display the umbrella. I don't get `ghost' characters that
are individual bytes of the multibyte character.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature
