[PR #13798] fix: Ctrl+V paste not working on Windows 11 TUI #14814

Open
opened 2026-02-16 18:19:34 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13798

State: open
Merged: No


Summary

Fix Ctrl+V paste not working in TUI on Windows 11.

Problem

On Windows 11, some terminals (cmd, PowerShell, Windows Terminal) may not properly send bracketed paste sequences, causing Ctrl+V to fail when pasting text.
The previous implementation only handled image paste via Ctrl+V and relied on terminal bracketed paste for text content, which does not work reliably on Windows.

Solution

Directly read clipboard and insert text when Ctrl+V is pressed, instead of relying on terminal bracketed paste.

  • Always call e.preventDefault() when input_paste keybind matches
  • Handle both image and text clipboard content directly
  • Insert text content using input.insertText() for text/plain MIME type

Testing

Tested on Windows 11 with Windows Terminal:

  • Ctrl+V now correctly pastes text from clipboard
  • Image paste still works as expected

Fixes #13800

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13798 **State:** open **Merged:** No --- ## Summary Fix Ctrl+V paste not working in TUI on Windows 11. ## Problem On Windows 11, some terminals (cmd, PowerShell, Windows Terminal) may not properly send bracketed paste sequences, causing Ctrl+V to fail when pasting text. The previous implementation only handled image paste via Ctrl+V and relied on terminal bracketed paste for text content, which does not work reliably on Windows. ## Solution Directly read clipboard and insert text when Ctrl+V is pressed, instead of relying on terminal bracketed paste. - Always call `e.preventDefault()` when `input_paste` keybind matches - Handle both image and text clipboard content directly - Insert text content using `input.insertText()` for `text/plain` MIME type ## Testing Tested on Windows 11 with Windows Terminal: - Ctrl+V now correctly pastes text from clipboard - Image paste still works as expected Fixes #13800
yindo added the pull-request label 2026-02-16 18:19:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14814