Skip to content

fix: Double input on arrow keys in AI setup prompt on Windows - #3552

Merged
ellie merged 1 commit into
atuinsh:mainfrom
lxl66566:fix-double-input
Jun 29, 2026
Merged

fix: Double input on arrow keys in AI setup prompt on Windows#3552
ellie merged 1 commit into
atuinsh:mainfrom
lxl66566:fix-double-input

Conversation

@lxl66566

Copy link
Copy Markdown
Contributor

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

Description

When pressing the Up/Down arrow keys in the Atuin AI setup prompt (?) on Windows (e.g., Git Bash / msys2), the cursor moves twice per physical keystroke.

This prevents the user from selecting the Disable ? Keybind option, which is located in the middle of the list.

~

  Atuin AI is not yet configured.

  > Enable Atuin AI
    Disable ? Keybind
    Cancel

To Reproduce

  1. Open Git Bash / msys2 on Windows.
  2. Press ? to trigger the AI setup prompt.
  3. Press the Down arrow key once.
  4. The cursor jumps two lines instead of one.

Fix

This is a known crossterm behavior on Windows. Since crossterm 0.26, it emits both KeyEventKind::Press and KeyEventKind::Release events on Windows.

In prompt_ai_setup, the event loop ignores KeyEventKind. Both the press and release events trigger the cursor movement.

So the fix is: Filter for KeyEventKind::Press in the event loop.

Signed-off-by: lxl66566 <lxl66566@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Fossier: Manual Review Requested

@lxl66566 is a new contributor. A maintainer should review this PR before merging.

Score Breakdown

Total Score: 58.2/100 | Confidence: 100% | Outcome: REVIEW

Signal Value Score Weight
account_age 1791 1.00 0.09
public_repos 171 1.00 0.05
contribution_history 186 0.93 0.05
follower_ratio 0.91 0.45 0.05
bot_signals False 0.50 0.04
open_prs_elsewhere 11 0.00 0.09
closed_prs_elsewhere 13 0.00 0.10
merged_prs_elsewhere 73 1.00 0.08
prior_interaction 0 0.00 0.08
activity_velocity 1 1.00 0.08
pr_content ... 1.00 0.08
commit_email no_email 0.50 0.04
pr_description ... 0.80 0.05
repo_stars 30381 0.30 0.04
org_membership 0 0.20 0.03
commit_verification ... 0.30 0.04
contributor_stars 229 1.00 0.04

@greptile-apps

greptile-apps Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR filters key events in the AI setup prompt.

  • Adds KeyEventKind to the prompt event imports.
  • Ignores non-press key events before handling selection input.
  • Keeps the change scoped to prompt_ai_setup.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
crates/atuin-ai/src/commands/inline.rs Adds press-only key event handling to the AI setup prompt; no actionable issue found.

Reviews (1): Last reviewed commit: "fix: double input on Windows" | Re-trigger Greptile

@ellie ellie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thank you! 🙏

@ellie
ellie merged commit 38ef1d6 into atuinsh:main Jun 29, 2026
26 checks passed
taylordotfish pushed a commit that referenced this pull request Jul 9, 2026
### Bug Fixes

- *(ai)* Dispatch skills registered in the slash command registry
([#3593](#3593))
- *(ci)* Fossier install in scan workflow
([#3485](#3485))
- *(i18n)* Fix typos in Russian localization
([#3575](#3575))
- *(nu)* Use `char -u 1b` for ESC in OSC 133 sequences
([#3530](#3530))
- *(nu)* Suppress error when `ATUIN_HISTORY_ID` is missing in
`pre_prompt` hook
([#3587](#3587))
- *(pi)* Observe tool events instead of registering a bash tool
([#3557](#3557))
- *(pty-proxy)* Set `$SHELL` to the spawned shell
([#3548](#3548))
- *(search)* Fix terminal clearing with latest Ratatui
([#3578](#3578))
- *(sync)* Skip records that fail to decrypt or decode instead of
failing the whole store
([#3569](#3569))
- Atuin hangs when attempting to spawn daemon from Ctrl+R invocation
([#3502](#3502))
- Capture session ID from stream headers rather than final event
([#3531](#3531))
- Doctor resiliency fo runknown platforms + openbsd warning
([#3551](#3551))
- Double input on arrow keys in AI setup prompt on Windows
([#3552](#3552))
- Exclude AI agent commands from zsh-autosuggestions
([#3567](#3567))
- Silence shellcheck SC2016 on literal `$all-user` author filter
- Respect `store_failed` when using daemon
([#3571](#3571))


### Documentation

- Highlight `Ctrl-r` keybinding on docs page
([#3489](#3489))
- Document store purge workflow
([#3544](#3544))
- Fix command example typo in documentation
([#3536](#3536))
- Make commented-out lines in `config.toml` match real defaults
([#3583](#3583))
- Add fish shell cleanup step to uninstall instructions
([#3582](#3582))


### Features

- *(doctor)* Add whether daemon is enabled to `doctor` output
([#3572](#3572))
- *(pty-proxy)* Add `--shell` flag to override the spawned shell
([#3327](#3327))
- Setup fossier to stop bot slop prs
([#3482](#3482))
- Capture command output + expose to new `atuin_output` tool
([#3510](#3510))
- Cache user contexts on load until `/reload`
([#3525](#3525))
- Create database integration tests for atuin-server
([#3514](#3514))
- Add `/model` slash command for changing models
([#3576](#3576))
- Add mcp server for history tools and expand search filters
([#3581](#3581))
- Add status bar with model and usage information
([#3591](#3591))


### Miscellaneous Tasks

- *(rustdoc)* Fix Rustdoc warnings
([#3585](#3585))
- *(warnings)* Fix compile warnings with latest dependencies
([#3586](#3586))
- Vouch for all existing contributors
([#3486](#3486))
- Update GitHub app token format
- Update to Rust 1.96.1
([#3568](#3568))
- Adopt `derive_more` to reduce boilerplate across the codebase
([#3573](#3573))


### Performance

- *(search)* Scan history by recency until N unique
([#3553](#3553))
- Add `synchronous(Normal)` + `optimize_on_close` to record store SQLite
([#3577](#3577))
- Remove unnecessary clones in a hot path
([#3580](#3580))


### Refactor

- Implement `From<sqlx::Error>` and clean up `fix_error`
([#3484](#3484))
- Pull `fn into_utc` into `atuin-server-database` crate
([#3487](#3487))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants