Commit Graph

8 Commits

Author SHA1 Message Date
roboomp d718d54a33 fix(coding-agent): restored windows image paste fallback
Fell back to the PowerShell clipboard bridge when the native Windows clipboard reader reports no image, preserving Ctrl+V image paste in PowerShell terminals.\n\nFixes #2429
2026-06-12 21:52:59 +00:00
can1357 5e7640c237 Revert "Merge pull request #2076: fix(coding-agent): prefer daemonizing CLI clipboards over arboard on Linux"
This reverts commit b3ed88d398, reversing
changes made to 26c6326f52.
2026-06-10 08:31:32 +02:00
can1357 ccf495441a style(coding-agent): drop stray blank line from rebase conflict resolution
Addresses rebase cleanup on #2076.
2026-06-10 08:26:06 +02:00
roboomp d4ce2a00cb fix(coding-agent): prefer daemonizing CLI tools over arboard for Linux clipboard
The native arboard backend cannot retain X11 / Wayland selection ownership
after the calling process exits, and for short-lived napi calls it can drop
ownership before any consumer sees the selection — leaving the clipboard
empty even though set_text returned success. tmux + QTerminal made this
visible because OSC 52 is also dropped by libqtermwidget, so both backends
fail and the UI's 'Copied to clipboard' status reads as a lie.

utils/clipboard.ts now:
- Tries wl-copy / xclip / xsel before arboard on Linux. These CLIs fork
  after reading stdin and serve the selection until another app claims it,
  so the payload survives our process exit.
- Honors OMP_CLIPBOARD_COMMAND as a shell-string escape hatch (e.g.
  `xclip -selection clipboard -in -silent`).
- Logs a single warning when every backend fails, so the silent-success
  regression from #2075 cannot recur unnoticed.

Tests assert dispatch order: Linux+X11 prefers xclip, Wayland prefers
wl-copy, xclip→xsel fallback works, all-fail falls back to native,
macOS still goes straight to native, and OMP_CLIPBOARD_COMMAND wins
over the CLI chain.

Fixes #2075
2026-06-10 08:26:05 +02:00
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00
can1357 81cec1c38b fix(clipboard): hardened WSL PowerShell fallback for headless environments
- Raised PowerShell timeout to 8s and swallowed reap errors to prevent unhandled throws on WSL interop.
- Fixed fallback logic so arboard is skipped when no display server is present on headless WSL.
- Added test coverage for the headless WSL short-circuit path.
2026-05-25 14:05:48 +02:00
roboomp 00233b24fa style: bun run fix 2026-05-22 09:47:52 +00:00
roboomp 8f83cbd9a9 fix(clipboard): route image reads through powershell.exe on WSL
WSLg exposes WAYLAND_DISPLAY, so readImageFromClipboard() took the
native arboard path on WSL2. arboard::Clipboard::get_image() returns
ContentNotAvailable on WSLg because the Wayland clipboard does not
carry image payloads from the Windows clipboard, and that surfaced as
silent 'No image in clipboard' on Ctrl+V.

Detect WSL via WSL_DISTRO_NAME / WSL_INTEROP and read the image with a
PowerShell one-liner that emits base64-encoded PNG bytes from
[System.Windows.Forms.Clipboard]::GetImage(). Fall back to the native
bridge when PowerShell returns nothing, exits non-zero, or is missing,
so non-WSLg Wayland setups continue working unchanged.

Fixes #1280
2026-05-22 09:47:47 +00:00