Skip to content

Commit 2441c95

Browse files
committed
Don't set foreground to false when stdout is a pipe
exec_bg is already set and the only two other effects it has are calling disable_input() and changing a debug log message. The former is not necessary to do when stdout is a pipe to fix the missing keystroke issue while the latter now matches ogsudo.
1 parent 91b9ce9 commit 2441c95

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/exec/use_pty/parent.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,6 @@ pub(in crate::exec) fn exec_pty(
134134
command.stderr(Stdio::inherit());
135135
}
136136

137-
// If there is another process later in the pipeline, don't interfere
138-
// with its access to the Tty
139-
if io::stdout().is_pipe() {
140-
foreground = false;
141-
}
142-
143137
// Copy terminal settings from `/dev/tty` to the pty.
144138
if let Err(err) = user_tty.copy_to(&pty.follower) {
145139
dev_error!("cannot copy terminal settings to pty: {err}");

0 commit comments

Comments
 (0)