Skip to content

fix(search): add enhanced_keyboard option to fix IME Enter commit#3559

Open
sailist wants to merge 2 commits into
atuinsh:mainfrom
sailist:fix/ime-enter-commit
Open

fix(search): add enhanced_keyboard option to fix IME Enter commit#3559
sailist wants to merge 2 commits into
atuinsh:mainfrom
sailist:fix/ime-enter-commit

Conversation

@sailist

@sailist sailist commented Jul 2, 2026

Copy link
Copy Markdown

Fixes #3558.

Summary

The interactive search TUI enables the kitty keyboard enhancement protocol. On terminals that implement it (e.g. iTerm2), this causes Enter during an active IME composition to be reported to Atuin instead of committing the composed text into the search box. CJK users (Chinese / Japanese / Korean) who type a search term and press Enter see the highlighted command run instead, and the typed letters are lost. A normal shell prompt is unaffected because it does not enable the protocol.

This PR adds a new enhanced_keyboard setting (default true, preserving existing behavior) that gates the PushKeyboardEnhancementFlags / PopKeyboardEnhancementFlags calls. Setting enhanced_keyboard = false restores the terminal's normal key handling so IME commits on Enter work again.

Changes

  • atuin-client/src/settings.rs: add enhanced_keyboard: bool with default true.
  • command/client/search/interactive.rs: thread the setting into Stdout, and only push/pop the keyboard enhancement flags when it is enabled (so we never pop a level we did not push).
  • atuin-client/config.toml template + docs/docs/configuration/config.md: document the new option.

Trade-off

With enhanced_keyboard = false, modifier keys that rely on the kitty protocol (Cmd / Super) and F1-F24 keys are not reported in the search TUI. Normal Ctrl / letter / arrow keys are unaffected. This only applies to users who explicitly set the option to false; the default behavior is unchanged.

Testing

The interactive search TUI enables the kitty keyboard enhancement protocol, which on some terminals (e.g. iTerm2) causes Enter during an active IME composition to be reported to Atuin instead of committing the composed text into the search box. Add an `enhanced_keyboard` setting (default true, preserving existing behavior) so users affected by CJK input methods can set it to false to restore normal IME handling.
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fossier: Manual Review Requested

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

Score Breakdown

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

Signal Value Score Weight
account_age 3429 1.00 0.09
public_repos 78 1.00 0.05
contribution_history 100 0.50 0.05
follower_ratio 2.68 1.00 0.05
bot_signals False 0.50 0.04
open_prs_elsewhere 9 0.00 0.09
closed_prs_elsewhere 9 0.10 0.10
merged_prs_elsewhere 59 1.00 0.08
prior_interaction 0 0.00 0.08
activity_velocity 2 0.67 0.08
pr_content ... 1.00 0.08
commit_email sailist@outlook.com 0.80 0.04
pr_description ... 0.80 0.05
repo_stars 30414 0.30 0.04
org_membership 0 0.20 0.03
commit_verification ... 0.30 0.04
contributor_stars 1082 1.00 0.04

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds an enhanced_keyboard setting (default true) that gates the kitty keyboard enhancement protocol push/pop in the search TUI, fixing IME Enter-commit issues for CJK users on terminals like iTerm2 without changing existing behavior for anyone who doesn't opt out.

  • The push/pop calls remain symmetric: on Windows the #[cfg] still suppresses both sides, and on other platforms the new if self.enhanced_keyboard guard wraps the existing #[cfg] correctly.
  • The version string 18.17 in docs/docs/configuration/config.md is a placeholder the author flagged; it needs to be updated to the actual release number before shipping.

Confidence Score: 4/5

Safe to merge once the placeholder version string in the docs is corrected.

The logic change is minimal and correct — push/pop remain symmetric across all platforms and the default preserves existing behavior entirely. The only thing to fix before shipping is the 18.17 version placeholder in the docs.

docs/docs/configuration/config.md — version placeholder needs updating.

Important Files Changed

Filename Overview
crates/atuin-client/src/settings.rs Adds enhanced_keyboard: bool field with default true — straightforward, no issues.
crates/atuin/src/command/client/search/interactive.rs Gates push/pop of kitty keyboard flags behind the new setting; the #[cfg] placement inside the if block is valid Rust and the push/pop remain symmetric.
crates/atuin-client/config.toml Adds commented-out enhanced_keyboard = true with an accurate description; no issues.
docs/docs/configuration/config.md Documents the new option; the version 18.17 is a placeholder that needs to be updated to the actual release before merging.

Reviews (1): Last reviewed commit: "fix(search): add enhanced_keyboard optio..." | Re-trigger Greptile

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.

Enter during CJK IME composition runs a command instead of committing text in the search TUI

1 participant