]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
utf8: assume tabs are 8 characters wide when written to console
authorLennart Poettering <lennart@poettering.net>
Fri, 26 Apr 2024 15:41:15 +0000 (17:41 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 14 Jun 2024 20:17:20 +0000 (21:17 +0100)
src/basic/utf8.c

index 36f0dc9cfd33e2861a0498c577ca30f931b8cccd..b5711f430014e49e76d9ff6c32efc667c0bc50aa 100644 (file)
@@ -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;