Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

feat: add Alt+V paste support for Windows Terminal - #2018

Closed
LittleDrinks wants to merge 1 commit into
MoonshotAI:mainfrom
LittleDrinks:feat/alt-v-paste-support
Closed

LittleDrinks wants to merge 1 commit into
MoonshotAI:mainfrom
LittleDrinks:feat/alt-v-paste-support

Conversation

@LittleDrinks

@LittleDrinks LittleDrinks commented Apr 23, 2026 •

Copy link
Copy Markdown

Windows Terminal intercepts Ctrl+V for its own text paste, so prompt_toolkit never receives the event. This PR adds Alt+V as a fallback key binding with identical media paste logic.


Open in Devin Review

Windows Terminal intercepts Ctrl+V for its own text paste, so
prompt_toolkit never receives the event. Alt+V (escape, v) is
bound as a fallback with identical media paste logic.
Copilot AI review requested due to automatic review settings April 23, 2026 03:31

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

Copy link
Copy Markdown
Contributor

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 1 additional finding.

Open in Devin Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an alternative paste shortcut to work around Windows Terminal intercepting Ctrl+V, ensuring clipboard/media paste remains accessible via Alt+V.

Changes:

  • Update toolbar tips to advertise ctrl-v/alt-v for clipboard paste.
  • Add an Alt+V (escape, v) key binding that mirrors the existing Ctrl+V paste behavior and telemetry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

]
if clipboard_available:
tips.append("ctrl-v: paste clipboard")
tips.append("ctrl-v/alt-v: paste clipboard")

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This tip text change will break the existing unit test that asserts the exact clipboard tooltip string (tests/ui_and_conv/test_prompt_tips.py::test_build_toolbar_tips_with_clipboard currently expects "ctrl-v: paste clipboard"). Update the test expectation (or adjust the tip formatting to preserve the old text) so CI stays green.

Suggested change
tips.append("ctrl-v/alt-v: paste clipboard")
tips.append("ctrl-v: paste clipboard")

Copilot uses AI. Check for mistakes.
Comment on lines +1487 to +1498
@_kb.add("escape", "v", eager=True)
def _(event: KeyPressEvent) -> None:
from kimi_cli.telemetry import track

track("shortcut_paste_alt")
if self._try_paste_media(event):
return
clipboard_data = event.app.clipboard.get_data()
if clipboard_data is None: # type: ignore[reportUnnecessaryComparison]
return
self._insert_pasted_text(event.current_buffer, clipboard_data.text)
event.app.invalidate()

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The Alt+V handler duplicates the Ctrl+V paste logic line-for-line, which makes future changes to paste behavior easy to miss in one of the two bindings. Consider sharing a single handler (e.g., stack two @_kb.add decorators on one function, or call a small shared helper) and pass a property/parameter to telemetry to distinguish ctrl vs alt if needed.

Copilot uses AI. Check for mistakes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants