Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Unicode problem



> The zero width character is drawn with width one?

Yes, that's what gnome-terminal is doing.  It seems to agree with the
screen width the library code is reporting (I didn't check explicitly
but the behaviour is consistent with that).

I think there are actually two widths involved here: the screen width
used with a fixed-size font for editing (applicable to zsh), and the
logical width of the character that would appear in a document.  The
latter is typically different to the former (in particular when a
variable width font is in use), and it's the latter case where it needs
to be zero width.  There's a kind of hybrid case for a WYSIWYG word
processor where it needs to flag up the space for editing even though
pretending it's behaving as zero-width, but this is a special case of
variable-width fonts.  The information in the library as returned by
wcwidth() is only applicable to fixed width fonts, where "zero width" is
essentially meaningless; a character width must be 1, 2, ...  So I think
gnome-terminal is doing the right thing here, although I can understand
the confusion.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author