fix(shell): handle Cmd+V image paste via BracketedPaste event#1434
Open
howardpen9 wants to merge 2 commits intoMoonshotAI:mainfrom
Open
fix(shell): handle Cmd+V image paste via BracketedPaste event#1434howardpen9 wants to merge 2 commits intoMoonshotAI:mainfrom
howardpen9 wants to merge 2 commits intoMoonshotAI:mainfrom
Conversation
When a user dismisses a question dialog (plan mode prompt, plan review, or AskUserQuestion) without choosing, the tool now returns is_error=True with an explicit "Do NOT proceed" instruction instead of a non-error result that tells the LLM to continue. Previously, EnterPlanMode returned "Proceed with implementation directly" on dismissal, causing the LLM to bypass planning and start coding — even when the user never gave permission. This was reported as reckless behavior in non-yolo mode. Closes MoonshotAI#1404
On macOS, Cmd+V is intercepted by the terminal emulator and sent as a bracketed paste event rather than the Ctrl+V key code. This means the existing `c-v` keybinding (which calls `_try_paste_media()` to detect clipboard images) is never triggered, and image file paths are inserted as raw text instead of `[image:...]` placeholders. Add a `Keys.BracketedPaste` handler that attempts media paste first, falling back to normal text insertion. This makes Cmd+V behave identically to Ctrl+V for image pasting. Closes MoonshotAI#1433
This was referenced Mar 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On macOS,
Cmd+Vis intercepted by the terminal emulator and delivered as a bracketed paste event, not theCtrl+Vkey code. The existingc-vkeybinding (which calls_try_paste_media()to detect clipboard images) is therefore never triggered — image file paths get inserted as raw text instead of[image:...]placeholders.This PR adds a
Keys.BracketedPastehandler that:_try_paste_media()first (same logic as thec-vhandler)This makes
Cmd+Vbehave identically toCtrl+Vfor clipboard image pasting.Closes #1433
Changes
src/kimi_cli/ui/shell/prompt.py: AddBracketedPastekeybinding handler inside theclipboard_availableblockTest plan
tests/ui_and_conv/test_prompt_clipboard.py— 10/10)ruff checkpassesCmd+Vin kimi CLI → verify[image:...]placeholder is insertedCmd+V→ verify text is pasted normallyCtrl+Vstill works as before