GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(tui): fix Ctrl+V paste on Windows/WSL2 (#6560 and #8209) by TakashiKyoto · Pull Request #8626 · anomalyco/opencode

Conversation

@TakashiKyoto

@TakashiKyoto TakashiKyoto commented Jan 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

What does this PR do?

Fixes #6560
Complementary to #8209 which fixes image filename extraction from Windows
file copy. This PR focuses on text paste failures and PowerShell escaping issues.

Ctrl+V paste was silently failing on Windows/WSL2 for text containing file
extensions (e.g., image.png, c:\path\file.txt).
Root cause: Bun.file().type infers MIME from extension without checking if file
exists. Text like image.png was treated as an image file path, failed to load,
and silently dropped. Additionally, on WSL2, clipboardy uses Linux clipboard
tools which cannot access Windows clipboard.

Fix:

  • Added file.exists() check before treating pasted text as file path
  • Added PowerShell clipboard read for Windows/WSL2 (using -EncodedCommand to
    avoid quoting issues with backslash paths)
  • Added explicit text paste handler in onKeyDown for terminals without
    bracketed paste support

How did you verify your code works?

Manually tested - pasting image paths now works perfectly in windows 11 WSL2 environment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

itsrainingmani, jtubbenhauer, gustavomata, and shiquda reacted with hooray emoji
All reactions
  • 🎉 4 reactions
@github-actions github-actions Bot added the needs:issue label Jan 15, 2026
@github-actions

github-actions Bot commented Jan 15, 2026

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

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

Based on my search, here are the related PRs I found:

Related PRs:

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

    • fix(tui): support clipboard image paste with proper filename on WSL2 #8209
    • Why related: This PR is explicitly mentioned in the current PR as complementary. While fix(tui): support clipboard image paste with proper filename on WSL2 #8209 fixes image filename extraction from Windows file copy, PR fix(tui): fix Ctrl+V paste on Windows/WSL2 (#6560 and #8209) #8626 focuses on text paste failures.
  2. feat: add input_copy and input_cut keybindings for keyboard-based text selection #7520 - feat: add input_copy and input_cut keybindings for keyboard-based text selection

    • feat: add input_copy and input_cut keybindings for keyboard-based text selection #7520
    • Why related: Also deals with clipboard/paste functionality in the TUI.
  3. fix(clipboard): add OSC 52 fallback for SSH/tmux environments #7028 - fix(clipboard): add OSC 52 fallback for SSH/tmux environments

    • fix(clipboard): add OSC 52 fallback for SSH/tmux environments #7028
    • Why related: Addresses clipboard handling issues in terminal environments, though focused on SSH/tmux rather than Windows/WSL2.

The most directly related is #8209, which is already referenced in the current PR description as a complementary fix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs:issue label Jan 15, 2026
@TakashiKyoto TakashiKyoto mentioned this pull request Jan 15, 2026
Paste into Powershell OpenCode instance not working #6560
Closed
@TakashiKyoto
TakashiKyoto force-pushed the fix/paste-windows-wsl2 branch from 1b4134d to 2a9fb0f Compare January 16, 2026 07:05
@github-actions github-actions Bot mentioned this pull request Jan 18, 2026
fix: Windows evaluating text on copy #9293
Merged
TakashiKyoto
fix(tui): fix Ctrl+V paste on Windows/WSL2
90b0caf
- Add file.exists() check before treating pasted text as file path
  (fixes silent failure for text containing ".png", ".jpg", etc.)
- Call event.preventDefault() FIRST in onPaste to prevent double-paste
  on WSL2/ConPTY terminals
- Simplify onKeyDown to handle images only; text fully handled by onPaste
- Add PowerShell clipboard read for WSL2 (clipboardy can't access Windows clipboard)
@TakashiKyoto
TakashiKyoto force-pushed the fix/paste-windows-wsl2 branch from 2a9fb0f to 90b0caf Compare January 21, 2026 13:39
This was referenced Jan 22, 2026
fix(tui): preserve agent state after compaction #10101
Closed
feat(opencode): add linux clipboard toast warnings #10332
Closed
@thdxr
thdxr force-pushed the dev branch from cbab81f to 2d3c7a0 Compare January 30, 2026 04:50
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 00637c0 to 71e0ba2 Compare January 30, 2026 14:32
@thdxr
thdxr force-pushed the dev branch 3 times, most recently from f1ae801 to 08fa7f7 Compare January 30, 2026 14:37
This was referenced Feb 11, 2026
fix(tui): make Windows image paste reliable #13161
Closed
fix: Ctrl+V paste not working on Windows 11 TUI #13798
Closed
fix: handle text clipboard paste on Ctrl+V for Windows terminals #13871
Closed
fix:solved the copy issue in TUI #14101
Closed
@github-actions github-actions Bot mentioned this pull request Mar 14, 2026
feat(tui): add double/triple click copy selection #17465
Closed
3 of 6 tasks
@pirrozani pirrozani mentioned this pull request Mar 15, 2026
fix(tui): add Alt+V as fallback keybind for image paste on Windows Terminal #17539
Closed
3 tasks done
@github-actions github-actions Bot mentioned this pull request Mar 20, 2026
fix(bug) paste image #18361
Closed
2 of 6 tasks
@github-actions

github-actions Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Paste into Powershell OpenCode instance not working

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@TakashiKyoto
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.