summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--term.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/term.c b/term.c
index 3cce287..4f6dda6 100644
--- a/term.c
+++ b/term.c
@@ -377,7 +377,9 @@ static void process_char(struct uuterm *t, unsigned c)
escape(t, c);
return;
}
- switch(w=wcwidth(c)) {
+ if (iswcntrl(c)) w = -1;
+ else if ((w = wcwidth(c)) < 0) w = 1;
+ switch(w) {
case -1:
switch (c) {
case 033: