Skip to content

fix: Ctrl+V paste not working on Windows 11 TUI#13798

Open
jabing wants to merge 2 commits intoanomalyco:devfrom
jabing:fix/ctrl-v-paste-windows
Open

fix: Ctrl+V paste not working on Windows 11 TUI#13798
jabing wants to merge 2 commits intoanomalyco:devfrom
jabing:fix/ctrl-v-paste-windows

Conversation

@jabing
Copy link

@jabing jabing commented Feb 16, 2026

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

Directly read clipboard and insert text when Ctrl+V is pressed,
instead of relying on terminal bracketed paste which may not work
reliably on Windows terminals.
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate PRs Found

#8626 - fix(tui): fix Ctrl+V paste on Windows/WSL2

  • Directly addresses the same Ctrl+V paste issue on Windows/WSL2 platforms. This appears to be a previous attempt at fixing this problem.

#13161 - fix(tui): make Windows image paste reliable

#8209 - fix(tui): support clipboard image paste with proper filename on WSL2

  • Related to clipboard image paste support on Windows/WSL environments.

These PRs are addressing similar or overlapping functionality (Ctrl+V paste, clipboard handling, and image paste on Windows). PR #8626 is particularly relevant as it's a previous fix for the exact same issue on Windows/WSL2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ctrl+V paste not working on Windows 11 TUI

1 participant