Skip to content
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

fix: ensure terminal has required read settings in non-canonical mode #409

merged 2 commits into from Mar 17, 2022

fix: ensure terminal has required read settings in non-canonical mode #409

merged 2 commits into from Mar 17, 2022


Copy link

@mgabeler-lee-6rs mgabeler-lee-6rs commented Feb 16, 2022

When taking the terminal out of canonical mode, the VMIN and VTIME values become important. The rest of the code in this repo (unsurprisingly) expects the terminal to still operate in blocking read mode. However in some situations, notably in some screen sessions (for unknown reasons), VMIN and VTIME may be set to 0 initially, which produces a range of errors, most commonly "false" EOF reports, but also sometimes panics.

The bug this fixes can be reproduced without messing about with screen simply by running stty min 0 time 0 before running any app that uses this library. A trivial test app I made to debug this issue is available at

fixes #408
see also cli/cli#4739

mislav approved these changes Feb 16, 2022
Copy link

@mislav mislav left a comment

Thank you! This looks good to me, especially because this is the same approach that uses too

Copy link

mislav commented Feb 16, 2022

The CI failure is likely intermittent and will probably be resolved by #404

Copy link
Contributor Author

mgabeler-lee-6rs commented Feb 16, 2022

OK ... I don't seem to have permission to re-run the CI test to check that, but the tests do pass for me locally

@mislav mislav merged commit 1b28f27 into AlecAivazis:master Mar 17, 2022
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Intermittent False EOF or panic when run under screen
2 participants