mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Replace the external clipboard dependency with small macOS, Windows, and X11 helpers and integrate them into coding-agent. Run native clipboard operations on worker threads and make command fallbacks asynchronous. Preserve incremental X11 transfers, legacy text encodings, native image formats, and existing Wayland and platform tools. Include native prebuilds with ARM64 page alignment, packaging updates, and regression coverage.
23 lines
909 B
Markdown
23 lines
909 B
Markdown
# Linux clipboard helper
|
|
|
|
Provides asynchronous X11 text and image reads using `libxcb.so.1`. Prebuilds support x64 and arm64 on glibc and musl. Reads have bounded waits; if a native operation stalls, the helper remains unavailable until it finishes.
|
|
|
|
Coding-agent falls back to command-line tools when native reads are unavailable. Wayland reads use `wl-paste`; all Linux writes use the existing command-line or terminal clipboard paths.
|
|
|
|
## Building
|
|
|
|
Install a C compiler and XCB development headers, then run from the repository root on each supported Linux architecture:
|
|
|
|
```sh
|
|
npm --prefix packages/tui run build:native:linux
|
|
```
|
|
|
|
## Testing
|
|
|
|
Install the build dependencies plus `pkg-config`, `Xvfb`, and `xclip`, then run from `packages/tui`:
|
|
|
|
```sh
|
|
node --test test/native-clipboard-linux.test.ts
|
|
```
|
|
|
|
Tests use isolated X11 servers, not the desktop clipboard. They skip when dependencies are missing.
|