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

This commit is contained in:
Lennart Poettering 2024-04-26 17:41:15 +02:00 committed by Luca Boccassi
parent 3c2f2146f5
commit b4aaba2bb0

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;