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

Merged
merged 3 commits into from
Jun 2, 2025

Conversation

willshuttleworth
Copy link
Contributor

@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
Contributor 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)

@cakebaker cakebaker linked an issue Jun 2, 2025 that may be closed by this pull request
@cakebaker cakebaker merged commit dfc4072 into uutils:main Jun 2, 2025
74 checks passed
@cakebaker
Copy link
Contributor

Thanks for your PR!

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.

stty panics when output is redirected
2 participants