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: prevent infinite loop when event reader fails to initialize #956

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aschey
Copy link
Contributor

@aschey aschey commented Dec 15, 2024

Possibly resolves #828.

This is reproducible on MacOS when using piped input without the use-dev-tty feature enabled. The event source fails to initialize, causing poll_internal to return an error, but this error is ignored and the loop never terminates.

I assume the retry behavior was implemented this way to prevent errors due to race conditions, so this fix preserves the original intent while ensuring the loop does eventually terminate.

@aschey aschey requested a review from TimonPost as a code owner December 15, 2024 19:57
@aschey aschey changed the title fix: prevent infinite loop when event read hangs fix: prevent infinite loop when event reader fails to initialize Dec 15, 2024
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.

On MacOS, crossterm::cursor::position() freezes the program when stdin is piped
1 participant