commit 748d5cab9a3d0d5d0edc28c8fd38430c684b1e55 from: Christian Weisgerber date: Mon Dec 14 22:15:50 2020 UTC replace unprintable characters with '.' before passing them to curses Otherwise, ncurses will replace them with some printable representation whose width we can't predict, and wunctrl() fails to return the replacement for 0x80..0x9f. ok stsp commit - f5a09613ce18eb49de0d07d7f7a1dbd5dcac25c8 commit + 748d5cab9a3d0d5d0edc28c8fd38430c684b1e55 blob - ca7f33b17ed856f59a4e0fc0cd5d1339a9ed6d93 blob + 8306375617fb59493e4cb3afb9648ec208873a0c --- tog/tog.c +++ tog/tog.c @@ -1190,10 +1190,13 @@ format_line(wchar_t **wlinep, int *widthp, const char if (wline[i] == L'\t') { width = TABSIZE - ((cols + col_tab_align) % TABSIZE); - if (cols + width > wlimit) - break; - cols += width; + } else { + width = 1; + wline[i] = L'.'; } + if (cols + width > wlimit) + break; + cols += width; i++; } else { err = got_error_from_errno("wcwidth");