summaryrefslogtreecommitdiff
path: root/src/basic/terminal-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/terminal-util.c')
-rw-r--r--src/basic/terminal-util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index c81aa400b..6de772117 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -1241,6 +1241,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;