feat: Add stream option for real-time output without requiring TTY #1180
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1179
Context
Currently, using
interactive: truein non-TTY environments (like VS Code's commit interface, GitHub Desktop, or CI/CD pipelines) fails with the error:This happens because
interactive: trueattempts to open/dev/ttyfor user input, which doesn't exist in these environments. Users who want real-time streaming output but don't need user input have no good alternative.Changes
This PR adds a new
streamconfiguration option that enables real-time log streaming without requiring a TTY:streamfield to Command, Script, and Job config structsexec_unix.goandexec_windows.goto handle stream mode/dev/ttyinteractive: trueattempts TTY access;stream: trueworks in all environmentsstreampropertydocs/mdbook/configuration/stream.mdKey differences:
stream: true- Real-time output, no TTY required, no user inputinteractive: true- Requires TTY for user inputuse_stdin: true- Passes stdin but doesn't control output streamingExample usage:
This allows developers to see test and lint output in real-time when committing from VS Code or other non-TTY environments, without encountering TTY errors.