utf8: assume tabs are 8 characters wide when written to console

This commit is contained in:
Lennart Poettering
2024-06-14 21:17:20 +01:00
committed by Luca Boccassi
parent 3c2f2146f5
commit b4aaba2bb0
+3
View 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;