fix(search): add enhanced_keyboard option to fix IME Enter commit#3559
fix(search): add enhanced_keyboard option to fix IME Enter commit#3559sailist wants to merge 2 commits into
Conversation
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.
Fossier: Manual Review Requested
Score BreakdownTotal Score: 58.3/100 | Confidence: 100% | Outcome: REVIEW
|
Greptile SummaryAdds an
Confidence Score: 4/5Safe 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 docs/docs/configuration/config.md — version placeholder needs updating. Important Files Changed
Reviews (1): Last reviewed commit: "fix(search): add enhanced_keyboard optio..." | Re-trigger Greptile |
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_keyboardsetting (defaulttrue, preserving existing behavior) that gates thePushKeyboardEnhancementFlags/PopKeyboardEnhancementFlagscalls. Settingenhanced_keyboard = falserestores the terminal's normal key handling so IME commits on Enter work again.Changes
atuin-client/src/settings.rs: addenhanced_keyboard: boolwith defaulttrue.command/client/search/interactive.rs: thread the setting intoStdout, 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.tomltemplate +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 tofalse; the default behavior is unchanged.Testing
cargo checkpasses onmain.atuin config get enhanced_keyboard --resolvedreflects the configured value and that the search TUI starts normally withenhanced_keyboard = false.