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.
This commit is contained in:
Lennart Poettering
2024-07-19 11:41:43 +02:00
parent 1df569b2e6
commit 1c685216f4
+2 -2
View File
@@ -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;
}