dustinblackman / oatmeal

Terminal UI to chat with large language models (LLM) using different model backends, and integrations with your favourite editors!
https://dustinblackman.com/posts/oatmeal/
MIT License
487 stars 23 forks source link

ctrl+c ctrl+c not working on Windows #5

Closed woelfman closed 9 months ago

woelfman commented 9 months ago

https://github.com/dustinblackman/oatmeal/blob/08f602a04cbc2ba80c10b9f0c313a682fe3da07e/src/application/ui.rs#L138

I haven't tried this on other platforms, but on Windows there is a null event that occurs right after ctrl+c, which resets app_state.exit_warning back to false, so ctrl+c ctrl+c doesn't work unless hold down the buttons.

A fix could look something like this:

-                app_state.exit_warning = false;
+                if input.key != tui_textarea::Key::Null {
+                    app_state.exit_warning = false;
+                }

The project builds on Windows, but due to a commit hook requiring cargo-run-bin, which depends on unix, I did not create a PR.

dustinblackman commented 9 months ago

Fixed in https://github.com/dustinblackman/oatmeal/commit/7cce417de57c319f9f92fd6c470c2afff0cc091a, I appreciate the report!

As for cargo-run-bin, while it's not fully Windows friendly, something basic like cargo bin committed should work fine. Though I don't have a Windows system to test on. Would you mind opening an issue over there so I could dig further, please? Thank you!