Fix wrong tty pump

See #1463
This commit is contained in:
LoveSy
2025-04-11 13:21:10 -07:00
committed by John Wu
parent c4847ed288
commit 9ddeab034b
4 changed files with 12 additions and 6 deletions
+3 -1
View File
@@ -239,7 +239,9 @@ int su_client_main(int argc, char *argv[]) {
if (atty) {
setup_sighandlers(sighandler);
pump_stdin_stdout(ptmx, ptmx);
// if stdin is not a tty, if we pump to ptmx, our process may intercept the input to ptmx and
// output to stdout, which cause the target process lost input.
pump_tty(ptmx, (atty & ATTY_IN) ? ptmx : -1);
}
// Get the exit code