Skip to content

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