feat(tui): open undo selector on double-Esc (#1220)

* feat(tui): open undo selector on double-Esc

Pressing Esc twice while idle now opens the undo selector, equivalent to running /undo with no arguments. Esc during streaming, compaction, or with a popup open keeps its cancel/close behavior and does not arm the double-press.

* fix(tui): disarm double-Esc undo on any intervening key

A pending double-Esc was only cleared by text changes, so a sequence like Esc, Ctrl-C, Esc within the window still opened the undo selector. Fire an onNonEscapeInput hook for every non-Escape key and clear the pending state there, so the shortcut only triggers for two consecutive Escape presses.
This commit is contained in:
liruifengv 2026-06-30 15:42:27 +08:00 committed by GitHub
parent 80e6888e34
commit ec51324230
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 205 additions and 0 deletions

View file

@ -39,6 +39,7 @@ Type `!` in an empty input box to enter shell mode and run terminal commands dir
| `Ctrl-V` | Paste an image or video from the clipboard (Unix / macOS) |
| `Alt-V` | Paste an image or video from the clipboard (Windows) |
| `Ctrl--` | Undo |
| `Esc` `Esc` | Open the undo selector (double-press while idle) |
Pressing `Ctrl-G` opens an external editor, selected according to the following priority:

View file

@ -39,6 +39,7 @@ Kimi Code CLI 的 TUI 交互模式支持一套键盘快捷键。键位按使用
| `Ctrl-V` | 粘贴剪贴板中的图片或视频Unix / macOS |
| `Alt-V` | 粘贴剪贴板中的图片或视频Windows |
| `Ctrl--` | 撤销Undo |
| `Esc` `Esc` | 双击打开撤销选择框(空闲状态下) |
`Ctrl-G` 会打开外部编辑器,编辑器按以下优先级选择: