st
simple terminal
git clone https://9o.is/git/st.git
commit 7107c46d89864693d3bc7594740a089b40cc0b77 parent fe94ba2610ac99f2ed928eb1e2684be01de2edad Author: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Mon, 17 Aug 2015 11:25:38 +0200 Do not mark as invalid UTF8 control codes wcwidth() returns -1 for all the non visible characters, but it doesn't necessarilly mean that they are incorrect. It only means that they are not printable. Diffstat:
| M | st.c | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/st.c b/st.c @@ -2895,15 +2895,15 @@ tputc(Rune u) int width, len; Glyph *gp; + control = ISCONTROL(u); len = utf8encode(u, c); - if ((width = wcwidth(u)) == -1) { + if (!control && (width = wcwidth(u)) == -1) { memcpy(c, "\357\277\275", 4); /* UTF_INVALID */ width = 1; } if (IS_SET(MODE_PRINT)) tprinter(c, len); - control = ISCONTROL(u); /* * STR sequence must be checked before anything else