From b4aaba2bb0091d50cbb5ef60afd04d4f6bbee456 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 26 Apr 2024 17:41:15 +0200 Subject: [PATCH] utf8: assume tabs are 8 characters wide when written to console --- src/basic/utf8.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/basic/utf8.c b/src/basic/utf8.c index 36f0dc9cfd3..b5711f43001 100644 --- a/src/basic/utf8.c +++ b/src/basic/utf8.c @@ -187,6 +187,9 @@ static int utf8_char_console_width(const char *str) { if (r < 0) return r; + if (c == '\t') + return 8; /* Assume a tab width of 8 */ + /* TODO: we should detect combining characters */ return unichar_iswide(c) ? 2 : 1; -- 2.47.3