Skip to content

Prefer the Windows clipboard and bound copy attempts on WSL - #53453

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/218c8541a169a16536db0370455e076a31a42b1f
Oct 12, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/218c8541a169a16536db0370455e076a31a42b1f

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Prefer the Windows clipboard and bound copy attempts on WSL

Why

WSLg clipboard initialization can block indefinitely, and PowerShell clipboard writes can stall while receiving input or exiting. These stalls can prevent subsequent TUI copy requests from completing.

What changed

  • Try the Windows clipboard first for /copy and Ctrl+O on WSL, falling back to the native clipboard and terminal delivery when needed.
  • Give Windows executable discovery and writing a shared five-second deadline, with a separate one-second deadline for native clipboard setup. Reuse pending setup tasks after timeouts to avoid accumulating blocked threads.
  • Launch PowerShell through a native shell and stop its process group on write failures or timeouts. Reap the writer before returning so an older copy cannot overwrite a newer one, and suppress stderr that could expose clipboard contents.

Testing

Add tests for command compatibility, large Unicode input, expired requests, and cleanup of stalled writers and subprocesses. Update routing tests to cover Windows-first copying and native fallback with HTML and clipboard leases.

## Why

WSLg clipboard initialization can block indefinitely, and PowerShell clipboard writes can stall while receiving input or exiting. These stalls can prevent subsequent TUI copy requests from completing.

## What changed

- Try the Windows clipboard first for `/copy` and `Ctrl+O` on WSL, falling back to the native clipboard and terminal delivery when needed.
- Give Windows executable discovery and writing a shared five-second deadline, with a separate one-second deadline for native clipboard setup. Reuse pending setup tasks after timeouts to avoid accumulating blocked threads.
- Launch PowerShell through a native shell and stop its process group on write failures or timeouts. Reap the writer before returning so an older copy cannot overwrite a newer one, and suppress stderr that could expose clipboard contents.

## Testing

Add tests for command compatibility, large Unicode input, expired requests, and cleanup of stalled writers and subprocesses. Update routing tests to cover Windows-first copying and native fallback with HTML and clipboard leases.

GitOrigin-RevId: 218c8541a169a16536db0370455e076a31a42b1f
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/218c8541a169a16536db0370455e076a31a42b1f branch from 5a6f1e8 to 0c329ad Compare October 12, 2026 19:02
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-12T19:02:47.190172Z 5a6f1e8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 0c329ad into main Oct 12, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/218c8541a169a16536db0370455e076a31a42b1f branch October 12, 2026 19:02
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 12, 2026
@mpuri1
mpuri1 deployed to issue-triage October 12, 2026 19:21 — with Image GitHub Actions Active
@mpuri1
mpuri1 deployed to issue-triage October 12, 2026 19:21 — with Image GitHub Actions Active
@mpuri1
mpuri1 deployed to issue-triage October 12, 2026 19:21 — with Image GitHub Actions Active
@mpuri1
mpuri1 deployed to issue-triage October 12, 2026 19:22 — with Image GitHub Actions Active
@HuaRyan
HuaRyan deployed to issue-triage October 12, 2026 19:37 — with Image GitHub Actions Active
@HuaRyan
HuaRyan deployed to issue-triage October 12, 2026 19:37 — with Image GitHub Actions Active
@HuaRyan
HuaRyan deployed to issue-triage October 12, 2026 19:37 — with Image GitHub Actions Active
@dean1012
dean1012 deployed to issue-triage October 12, 2026 20:13 — with Image GitHub Actions Active
@dean1012
dean1012 deployed to issue-triage October 12, 2026 20:13 — with Image GitHub Actions Active
@dean1012
dean1012 deployed to issue-triage October 12, 2026 20:13 — with Image GitHub Actions Active
@cds-SFAI
cds-SFAI deployed to issue-triage October 12, 2026 20:14 — with Image GitHub Actions Active
@cds-SFAI
cds-SFAI deployed to issue-triage October 12, 2026 20:14 — with Image GitHub Actions Active
@cds-SFAI
cds-SFAI deployed to issue-triage October 12, 2026 20:14 — with Image GitHub Actions Active
@LNXBeats
LNXBeats deployed to issue-triage October 12, 2026 20:15 — with Image GitHub Actions Active
@LNXBeats
LNXBeats deployed to issue-triage October 12, 2026 20:15 — with Image GitHub Actions Active
@LNXBeats
LNXBeats deployed to issue-triage October 12, 2026 20:15 — with Image GitHub Actions Active
@LNXBeats
LNXBeats deployed to issue-triage October 12, 2026 20:16 — with Image GitHub Actions Active
@mmichalt
mmichalt deployed to issue-triage October 12, 2026 20:28 — with Image GitHub Actions Active
@mmichalt
mmichalt deployed to issue-triage October 12, 2026 20:28 — with Image GitHub Actions Active
@mmichalt
mmichalt deployed to issue-triage October 12, 2026 20:28 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 0c329ad2 Deployed Oct 12, 2026 by ShanYan07 via Identify potential duplicates (all issues) #54861
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.