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: Better handling of Escape and Enter keys #915

Conversation

marc2332
Copy link
Contributor

Fixes

  • No more need to press twice the Enter key in ConfirmQuit, Welcome or Assistant routes.
  • Writing (and therefore pasting) was allowed while rendering the Assistant route. You could run stuff by pasting scripts with breaklines without the need to go to the terminal route

LMK if I broke something but from my own tests all went just fine

@marc2332
Copy link
Contributor Author

marc2332 commented Jan 19, 2025

for context: The double enter issue was caused because the first press of Enter was not requesting a rerender, this was because has_key_wait was returning true in all cases except when the route was already Terminal, causing the first render not happen.

The second render was triggered simply because the route in that moment was the Terminal, and therefore an Enter in the shell causes a break of line, leading to a rerender.

Copy link
Owner

@raphamorim raphamorim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@raphamorim raphamorim merged commit bfb2682 into raphamorim:main Jan 21, 2025
7 checks passed
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.

2 participants