summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-04 18:47:56 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-04 18:47:56 -0400
commit20f8477be541f2486737f1be32bdb0bd0d6372fd (patch)
treeb99412abf9bf45fddc04ef330f5546059d3a444d /src/shared
parent3fb1ac5d57954bb0d881a68777e996b46ed44ce3 (diff)
parentac83514cbf5997938344d5fbcfcbfd5021f453f9 (diff)
Merge pull request #3392 from poettering/assorted-stuff
Assorted stuff
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/ask-password-api.c6
-rw-r--r--src/shared/pager.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index 4a4bd8d3b8..a86b0db554 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -253,10 +253,12 @@ int ask_password_tty(
goto finish;
}
- loop_write(ttyfd, ANSI_HIGHLIGHT, strlen(ANSI_HIGHLIGHT), false);
+ if (colors_enabled())
+ loop_write(ttyfd, ANSI_HIGHLIGHT, strlen(ANSI_HIGHLIGHT), false);
loop_write(ttyfd, message, strlen(message), false);
loop_write(ttyfd, " ", 1, false);
- loop_write(ttyfd, ANSI_NORMAL, strlen(ANSI_NORMAL), false);
+ if (colors_enabled())
+ loop_write(ttyfd, ANSI_NORMAL, strlen(ANSI_NORMAL), false);
new_termios = old_termios;
new_termios.c_lflag &= ~(ICANON|ECHO);
diff --git a/src/shared/pager.c b/src/shared/pager.c
index c16bc027be..a2524d4420 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -63,7 +63,7 @@ int pager_open(bool no_pager, bool jump_to_end) {
if (pager_pid > 0)
return 1;
- if (!on_tty())
+ if (terminal_is_dumb())
return 0;
pager = getenv("SYSTEMD_PAGER");