Skip to content

fix(terminal): only accept actual keypresses in menus#2020

Merged
GideonBear merged 7 commits into
topgrade-rs:mainfrom
uwuclxdy:menu-fix
May 15, 2026
Merged

fix(terminal): only accept actual keypresses in menus#2020
GideonBear merged 7 commits into
topgrade-rs:mainfrom
uwuclxdy:menu-fix

Conversation

@uwuclxdy
Copy link
Copy Markdown
Member

What does this PR do

Fixes #2016
Uses crossterm crate to get the keypress events and discards any other ones (like paste). Enter is used for default selection in prompt_yesno().

Standards checklist

  • The PR title is descriptive
  • I have read CONTRIBUTING.md
  • Optional: I have tested the code myself, with the relevant tools installed. If yes, add Topgrade's output of the relevant steps.
  • If this PR introduces new user-facing messages they are translated

AI involvement

Consulted with Claude about it and modified some code snippets that it gave me. Also for review.

@GideonBear

This comment was marked as resolved.

@uwuclxdy

This comment was marked as resolved.

@uwuclxdy uwuclxdy changed the title fix(terminal): use crossterm for interactive prompts fix(terminal): only accept actual keypresses in topgrade's menus May 15, 2026
Comment thread src/terminal.rs Outdated
Comment thread src/terminal.rs Outdated
Comment thread Cargo.toml
Comment thread Cargo.lock Outdated
@GideonBear GideonBear changed the title fix(terminal): only accept actual keypresses in topgrade's menus fix(terminal): only accept actual keypresses in menus May 15, 2026
@GideonBear
Copy link
Copy Markdown
Member

Thanks!

@GideonBear GideonBear merged commit 20185c6 into topgrade-rs:main May 15, 2026
20 checks passed
@github-actions github-actions Bot mentioned this pull request May 13, 2026
@uwuclxdy
Copy link
Copy Markdown
Member Author

yayy, thank you, no more reboot by pasting text :D

@uwuclxdy uwuclxdy deleted the menu-fix branch May 15, 2026 19:38
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.

Topgrade should not treat (pasted) text as keybinds in the end and retry menu

2 participants