Ctrl+V paste not working on Windows 11 TUI #9442

Open
opened 2026-02-16 18:12:27 -05:00 by yindo · 2 comments
Owner

Originally created by @jabing on GitHub (Feb 16, 2026).

Originally assigned to: @kommander on GitHub.

Description

Bug Description

On Windows 11, Ctrl+V does not paste text in the TUI prompt. The issue occurs in Windows Terminal, cmd, and PowerShell.

Plugins Used

None

OpenCode Version

1.1.53

Steps to Reproduce

  1. Install opencode on Windows 11
  2. Start TUI: opencode
  3. Copy some text to clipboard
  4. Press Ctrl+V in the prompt
  5. Expected text to be pasted, but nothing happens

Root Cause

The current implementation only handles image paste via Ctrl+V and relies on terminal bracketed paste for text content. However, Windows terminals may not properly send bracketed paste sequences.

Environment

  • OS: Windows 11
  • Terminal: Windows Terminal / cmd / PowerShell

Proposed Fix

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

Plugins

None

OpenCode version

1.1.53

Steps to reproduce

  1. Install opencode on Windows 11
  2. Start TUI: opencode
  3. Copy some text to clipboard
  4. Press Ctrl+V in the prompt
  5. Expected text to be pasted, but nothing happens

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal / cmd / PowerShell

Originally created by @jabing on GitHub (Feb 16, 2026). Originally assigned to: @kommander on GitHub. ### Description ## Bug Description On Windows 11, Ctrl+V does not paste text in the TUI prompt. The issue occurs in Windows Terminal, cmd, and PowerShell. ## Plugins Used None ## OpenCode Version 1.1.53 ## Steps to Reproduce 1. Install opencode on Windows 11 2. Start TUI: `opencode` 3. Copy some text to clipboard 4. Press Ctrl+V in the prompt 5. Expected text to be pasted, but nothing happens ## Root Cause The current implementation only handles image paste via Ctrl+V and relies on terminal bracketed paste for text content. However, Windows terminals may not properly send bracketed paste sequences. ## Environment - OS: Windows 11 - Terminal: Windows Terminal / cmd / PowerShell ## Proposed Fix Directly read clipboard and insert text when Ctrl+V is pressed, instead of relying on terminal bracketed paste. ### Plugins None ### OpenCode version 1.1.53 ### Steps to reproduce 1. Install opencode on Windows 11 2. Start TUI: `opencode` 3. Copy some text to clipboard 4. Press Ctrl+V in the prompt 5. Expected text to be pasted, but nothing happens ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal / cmd / PowerShell
yindo added the windowsopentuibug labels 2026-02-16 18:12:27 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 16, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9922: Windows & Ubuntu: impossible to paste API key after /connect (Ctrl-V / Ctrl-Shift-V / right-click all fail, no hints)
  • #12595: window10,无法使用ctrl+c,ctrl+v 复制粘贴 (Ctrl+V paste not working on Windows 10)
  • #3343: Cannot paste multiple lines in Windows Terminal and VSCode+Powershell

If you have additional details or information not covered in these issues, please mention them here.

@github-actions[bot] commented on GitHub (Feb 16, 2026): This issue might be a duplicate of existing issues. Please check: - #9922: Windows & Ubuntu: impossible to paste API key after /connect (Ctrl-V / Ctrl-Shift-V / right-click all fail, no hints) - #12595: window10,无法使用ctrl+c,ctrl+v 复制粘贴 (Ctrl+V paste not working on Windows 10) - #3343: Cannot paste multiple lines in Windows Terminal and VSCode+Powershell If you have additional details or information not covered in these issues, please mention them here.
Author
Owner

@yxshee commented on GitHub (Feb 16, 2026):

Fixed in this pr #13871

Root Cause

The onKeyDown handler for input_paste (Ctrl+V) in prompt/index.tsx calls Clipboard.read(), which successfully reads both images and text from the clipboard. However, only the image/* case was handled — for text content, the handler fell through expecting the terminal to emit a bracketed paste sequence. Windows Terminal, cmd, and PowerShell do not reliably send bracketed paste sequences for Ctrl+V key presses, causing text paste to silently fail.

Fix

clipboard.ts: Added Clipboard.readText() — a dedicated text reader that uses clipboardy.read() and normalizes CRLF/CR line endings to LF.

@yxshee commented on GitHub (Feb 16, 2026): Fixed in this pr #13871 ## Root Cause The `onKeyDown` handler for `input_paste` (Ctrl+V) in [prompt/index.tsx](cci:7://file:///Users/venom/opencode/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx:0:0-0:0) calls `Clipboard.read()`, which successfully reads both images and text from the clipboard. However, only the `image/*` case was handled — for text content, the handler fell through expecting the terminal to emit a bracketed paste sequence. Windows Terminal, cmd, and PowerShell do not reliably send bracketed paste sequences for Ctrl+V key presses, causing text paste to silently fail. ## Fix **[clipboard.ts](cci:7://file:///Users/venom/opencode/packages/opencode/src/cli/cmd/tui/util/clipboard.ts:0:0-0:0)**: Added `Clipboard.readText()` — a dedicated text reader that uses `clipboardy.read()` and normalizes CRLF/CR line endings to LF.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9442