refactor TUI event loop to enable dropping + recreating crossterm event stream
Introduces an EventBroker between the crossterm EventStream source and the consumers in the TUI. This enables dropping + recreating the crossterm_events without invalidating the consumer.
Dropping and recreating the crossterm event stream enables us to fully relinquish stdin while the app keeps running. If the stream is not dropped, it will continue to read from stdin even when it is not actively being polled, potentially stealing input from other processes. See here and here for details.
Tests
Added tests for new EventBroker setup, existing tests pass, tested locally.
@codex review this
Codex Review: Didn't find any major issues. Keep them coming!
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
@codex review this
@codex review this
Codex Review: Didn't find any major issues. Can't wait for the next one!
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".