Files
codex/codex-rs/tui/src/clipboard_copy
Eric Traut 1f9549e265 Support PRIMARY selection in Wayland sessions (#64192)
## Why

The TUI disabled PRIMARY whenever `WAYLAND_DISPLAY` was set, so it
couldn't publish selected text to PRIMARY or paste from it with a middle
click in Wayland sessions.

## What changed

Probe Wayland PRIMARY support in the background and use the result for
selection copying and middle-click paste. If the compositor lacks the
Wayland data-control protocol, allow XWayland fallback only when the
Wayland and X11 sockets have matching listener credentials.

## Testing

Add a unit test covering native Wayland support, the same-session
XWayland fallback, remote X11 displays, and unsuccessful probes.

GitOrigin-RevId: 9b5c1536762383c0fe770dd86d58a49a1f3633a8
2026-11-26 17:55:06 +00:00
..