Editor-menu Copy/Cut and Explorer Copy Path do not reach the terminal clipboard on Linux
Problem
I'm using tode with its bundled code-server inside Herdr on Linux. Editor-menu Copy/Cut and Explorer Copy Path / Copy Relative Path did not reliably make the selected text or path available when I pasted into another terminal pane.
Environment
- tode v0.4.3 / Pixel 0.0.23 / Electron 44.2.0
- bundled code-server 4.132.0, using a secure loopback origin
- Linux x86_64 / Wayland / Herdr
Reproduction
On an unmodified installation:
- Select disposable editor text and choose menu Copy or Cut.
- Paste into another terminal pane or text editor.
- Repeat with Explorer Copy Path and Copy Relative Path.
Expected: the selected text or path is available externally.
Observed in this setup: application-owned copy operations do not reliably reach the surrounding terminal clipboard.
Scope and prepared change
Tode's existing preload/daemon forward theme and timing messages, but not these clipboard operations. A local bridge for trusted Copy/Cut events and validated Clipboard API writes restored the menu/path workflow for me; I also confirmed normal cross-pane copy/paste. Incoming multiline Unicode paste worked without replacing native paste.
I've prepared a source change here: https://github.com/ibrmora/terminal-code/tree/fix/clipboard-bridge
The full source suite passes 167 tests, including 39 new clipboard tests, and typecheck passes. Those source tests use mocked endpoints; the newer source build has not been launched as a replacement application. No video is attached.
This is distinct from #24, which reports macOS/cmux keyboard copying while menu Copy works. The separate Pixel EditContext keyboard selection issue and source PR are zenbu-labs/terminal-browser#245 and zenbu-labs/terminal-browser#246; the browser's separate menu/API bridge is zenbu-labs/terminal-browser#247 and zenbu-labs/terminal-browser#249.
Editor menu Copy/Cut and Explorer Copy Path miss the terminal clipboard on Linux/Wayland
Problem
On Linux (Wayland, inside Herdr), text copied with the editor menu Copy/Cut in code-server does not reliably reach the clipboard that other terminal panes paste from. The same happens with Explorer Copy Path and Copy Relative Path. The reporter uses tode v0.4.3, Pixel 0.0.23, Electron 44.2.0 and code-server 4.132.0.
Steps to reproduce
- Read
src/app/preload.ts. It sends onlythemeandtimingmessages ontode:message. It sends no clipboard events. - Read
src/app/daemon.tspage(). The webview getsclipboardRead: true. Writes from the page go to Electron's own clipboard, through Pixel'sclipboard-sanitized-writegrant. - Tried to find a code path to run without Electron, a Wayland compositor and Herdr. None of the copy path can run in this sandbox.
Expected
After menu Copy/Cut or Copy Path, pasting in another Herdr pane or an external editor inserts the selected text or path.
Actual
The reporter says the copied text or path is often not available in other panes. The report does not include exact values or how often it fails.
Evidence
Not reproduced. The copy path runs inside Electron's clipboard and the Wayland compositor, and this headless Linux container has neither, so no test or terminal demo can run it.
Open questions
- Should tode add a preload-to-daemon clipboard bridge, as the reporter's branch does, or should Pixel/Electron clipboard sync on Wayland handle this?
Extra information
| Job | 41648465057-1 |
| Handler | issue.enhance |
| Classification | bug |
| Sandbox | docker · linux |
| Log | GitHub Actions run |