Files
codex/codex-rs/utils/path-utils
Eric Traut 09c711b783 Use clip.exe for single-line ASCII clipboard copies in WSL (#61724)
## Why

Single-line ASCII copies can use the lightweight Windows clipboard writer without starting PowerShell.

## What changed

- Try `clip.exe` for printable ASCII text and tabs, falling back to PowerShell if it is unavailable or fails. Bound discovery and execution by short deadlines.
- Keep PowerShell for Unicode, multiline text, and other control characters. Pad even-length ASCII input with a trailing NUL to prevent `clip.exe` from interpreting it as UTF-16.
- Preserve precedence and command compatibility for installed Linux `powershell.exe` adapters, and defer Windows PowerShell discovery until needed.

## Testing

Extend WSL clipboard tests to cover input eligibility and padding, adapter precedence, and expired deadlines.

GitOrigin-RevId: 69b66ec1243452d0a4df119563321f38d177bea9
2026-11-16 02:39:33 +00:00
..