gui-cs / Terminal.Gui

Cross Platform Terminal UI toolkit for .NET
MIT License
9.68k stars 690 forks source link

CursesDriver doesn't render wide codepoints correctly #2796

Open tig opened 1 year ago

tig commented 1 year ago

Curses is doing something funky with glyphs that report GetColums() of 1 yet are rendered wide. E.g. 0x2064 (invisible times) is reported as 1 column but is rendered as 2. WindowsDriver & NetDriver correctly render this as 1 column, overlapping the next cell.

I've spent many hours trying to figure this out. I'm at a loss.

JT9gIoo 1

I'm pretty sure curses is actively trying to determine a codepoint is wide and ignoring wcwidth (which it does use, and I've verified is that latest).

I suspect the way to address this is to stop using Curses.addstr etc... and instead emit ANSI sequences directly to the output stream.

tig commented 3 months ago

Relevant. Esp 2070.

https://github.com/mintty/mintty/blob/master/wiki/CtrlSeqs.md

dodexahedron commented 3 months ago

Another good set of characters to be sure to test things with is the wide decimal digits. They count as numbers but are multibyte and supposed to render as 2 columns.