Skip to content

stty: fix output redirection #8016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

willshuttleworth
Copy link

@willshuttleworth willshuttleworth commented May 27, 2025

Fix related to this issue. I have removed the Device enum that had a variant for a file and for stdout. Instead, just using a file passed with --file flag or /dev/tty by default. Output redirection (redirecting to file or pipe) now works.

In terms of testing, the same issues exist with other stty testing as cargo test doesn't run in a tty. I have added tests in a related PR, but these tests are limited to inputs that should fail.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@willshuttleworth
Copy link
Author

Instead of defaulting to /dev/tty with no fallback, now I'm trying /dev/tty first then falling back to stdout

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

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.

1 participant