systemctl: don't do ANSI underlining on TERM=linux (#6778)
The linux console apparently can't do underlining, hence let's not do it on the console. Also see: #6601
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
c5aaaebced
commit
526664f627
@@ -1228,6 +1228,22 @@ bool colors_enabled(void) {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
bool underline_enabled(void) {
|
||||
static int enabled = -1;
|
||||
|
||||
if (enabled < 0) {
|
||||
|
||||
/* The Linux console doesn't support underlining, turn it off, but only there. */
|
||||
|
||||
if (!colors_enabled())
|
||||
enabled = false;
|
||||
else
|
||||
enabled = !streq_ptr(getenv("TERM"), "linux");
|
||||
}
|
||||
|
||||
return enabled;
|
||||
}
|
||||
|
||||
int vt_default_utf8(void) {
|
||||
_cleanup_free_ char *b = NULL;
|
||||
int r;
|
||||
|
||||
Reference in New Issue
Block a user