From: Lennart Poettering Date: Wed, 10 Jul 2024 14:32:22 +0000 (+0200) Subject: terminal-util: turn off echo on stdin, not stdout X-Git-Tag: v257-rc1~873^2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c685216f4c48e1de6e58f6a86b76b488981e387;p=thirdparty%2Fsystemd.git terminal-util: turn off echo on stdin, not stdout This doesn't make much of a different IRL, but it feels more right that an operation that happens in input is turned off via the input fd. --- diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index ad225995532..5ebb7e0a74b 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -1752,7 +1752,7 @@ int get_default_background_color(double *ret_red, double *ret_green, double *ret struct termios new_termios = old_termios; termios_disable_echo(&new_termios); - if (tcsetattr(STDOUT_FILENO, TCSADRAIN, &new_termios) < 0) + if (tcsetattr(STDIN_FILENO, TCSADRAIN, &new_termios) < 0) return -errno; r = loop_write(STDOUT_FILENO, "\x1B]11;?\x07", SIZE_MAX); @@ -1813,6 +1813,6 @@ int get_default_background_color(double *ret_red, double *ret_green, double *ret } finish: - (void) tcsetattr(STDOUT_FILENO, TCSADRAIN, &old_termios); + (void) tcsetattr(STDIN_FILENO, TCSADRAIN, &old_termios); return r; }