Skip to content

Conversation

squell
Copy link
Member

@squell squell commented Sep 9, 2025

This disabled polling the stdin file descriptor (which causes input to be grabbed by sudo) if stdout is not connected to a terminal. This is similar to what ogsudo does (in fact this fix was suggested by Todd).

This fixes #1260 for me.

To be more confirming, we should probably only set the process to background mode if stdout is connected to a pipe. But currently the mode "trying to read from the TTY" when stdout is not connected to the TTY results in a recognizable error condition anyway (I don't believe this is by design, but before we change that we may need to consider whether the current behaviour has security benefits).

@squell squell merged commit 89fc419 into main Sep 12, 2025
17 checks passed
@squell squell deleted the background-on-pipe branch September 12, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missed keystrokes when executing in a pipe
2 participants