Skip to content

fix: add Alt+V as alternative paste shortcut on Windows#1505

Closed
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67:fix/windows-alt-v-paste
Closed

fix: add Alt+V as alternative paste shortcut on Windows#1505
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67:fix/windows-alt-v-paste

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 19, 2026

Related Issue

Resolve #781

Description

Windows Terminal intercepts Ctrl+V for its own paste operation, preventing it from reaching Kimi CLI. This adds Alt+V (escape v in 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+V binding — 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:

  • Windows: ctrl-v / alt-v: paste clipboard
  • macOS: cmd-v / ctrl-v: paste clipboard
  • Linux: ctrl-v: paste clipboard

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

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
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +1206 to +1209
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)

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] Ctrl+V 无法在 Windows Terminal 中粘贴图片,建议添加 Alt+V 备选快捷键

2 participants