From 1c685216f4c48e1de6e58f6a86b76b488981e387 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Jul 2024 16:32:22 +0200 Subject: [PATCH] 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. --- src/basic/terminal-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.47.3