fix: add Alt+V as alternative paste shortcut on Windows#1505
fix: add Alt+V as alternative paste shortcut on Windows#1505Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Conversation
Closes MoonshotAI#781 Windows Terminal intercepts Ctrl+V for its own paste operation, preventing it from reaching Kimi CLI. This adds Alt+V (escape v) as an alternative paste shortcut on Windows, matching the approach used by Claude Code. Also updates toolbar tips to show platform-appropriate paste shortcuts: - Windows: ctrl-v / alt-v - macOS: cmd-v / ctrl-v - Linux: ctrl-v
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97afedc3b0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if sys.platform == "win32": | ||
| # On Windows Terminal, Ctrl+V is intercepted by the terminal | ||
| # for its own paste. Add Alt+V as an alternative shortcut. | ||
| @_kb.add("escape", "v", eager=True) |
There was a problem hiding this comment.
Avoid hijacking literal
Esc then v on Windows
In CustomPromptSession.__init__, this binds ("escape", "v") eagerly for every Windows session. In prompt_toolkit, Alt+v is reported as the same key sequence as pressing Esc and then v, so any user who hits Escape first and then types a word starting with v will trigger paste instead of inserting v. Because the binding is global and has no additional filter, this becomes a real editing regression in normal prompt use, not just an alternate shortcut.
Useful? React with 👍 / 👎.
Related Issue
Resolve #781
Description
Windows Terminal intercepts
Ctrl+Vfor its own paste operation, preventing it from reaching Kimi CLI. This addsAlt+V(escape vin prompt_toolkit) as an alternative paste shortcut on Windows, matching the approach used by Claude Code.The handler reuses the same logic as the existing
Ctrl+Vbinding — it first attempts media paste via_try_paste_media(), then falls back to text paste from the clipboard.Also updates the toolbar tips to show platform-appropriate paste shortcuts:
ctrl-v / alt-v: paste clipboardcmd-v / ctrl-v: paste clipboardctrl-v: paste clipboardChecklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.