fix(opencode): image paste on Windows Terminal 1.25+ with kitty keyboard#17674
Open
Hona wants to merge 2 commits intoanomalyco:devfrom
Open
fix(opencode): image paste on Windows Terminal 1.25+ with kitty keyboard#17674Hona wants to merge 2 commits intoanomalyco:devfrom
Hona wants to merge 2 commits intoanomalyco:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the TUI paste handling to support image paste on Windows Terminal Preview when kitty keyboard mode is enabled, by enabling key release events and using Ctrl+V release as the signal to probe the clipboard for image data.
Changes:
- Enable kitty keyboard
events: truein the TUI renderer config. - Add a Windows-only Ctrl+V release keyboard handler in the prompt to trigger an image clipboard probe/paste.
- Clarify clipboard/paste-path behavior with additional inline comments.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/opencode/src/cli/cmd/tui/util/clipboard.ts | Adds documentation about Windows-specific paste trigger paths and clarifies why direct clipboard probing is needed for images. |
| packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx | Adds Ctrl+V release detection on Windows to paste clipboard images; updates comments around paste behavior. |
| packages/opencode/src/cli/cmd/tui/app.tsx | Enables kitty keyboard events globally so key release events can be observed (needed for WT Preview behavior). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
34e50c3 to
342719d
Compare
This was referenced Mar 16, 2026
Member
Author
|
vouch @Hona |
rekram1-node
approved these changes
Mar 18, 2026
This was referenced Mar 19, 2026
Closed
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
events: trueso Windows Terminal 1.25+ reports key release eventsDepends on anomalyco/opentui#819 (stdin parser fix for split escape sequences across reads) for stability, without the opentui change, only about half of ctrl+v events are detected.
Context
Windows Terminal 1.25+ with kitty keyboard support does not send an empty bracketed paste for image-only clipboard (stable WT does). The only signal we get is the Ctrl+V key release event (
CSI 118;modifier;3u), which requiresevents: truein the kitty keyboard config.