hermes-agent/ui-tui/packages/hermes-ink/src/utils
ethernet c42edd8055 fix(tui): clipboard copy on linux/wayland
`probeLinuxCopy` and `copyNative` in `osc.ts` await `execFileNoThrow`
for wl-copy / xclip / xsel. Those tools double-fork a daemon that
holds the system selection live, and the daemon inherits stdio pipes
from `spawn(stdio: 'pipe')`. Node's 'close' event only fires when
stdio is fully closed → the daemon keeps the pipes open → 'close'
never fires → the await leaks past the timeout (kill(SIGTERM) on an
already-exited child is a no-op, daemon survives).

Result: `linuxCopy` cache stays `undefined` permanently, the actual
copy never runs, ctrl-c silently does nothing on wayland/x11.
Reproduced in isolation, confirmed across wl-copy and a
daemonization-shaped fixture.

Fix: add `resolveOnExit` option to `execFileNoThrow`. When set, the
promise settles on the immediate child's 'exit' event instead of
waiting for stdio drainage. Wired into both the probe and the actual
copy spawns for every clipboard tool (pbcopy, wl-copy, xclip, xsel,
clip).

Tests: 5 new vitest cases covering daemon-style child handling,
non-zero exit propagation, timeout behavior, and double-resolve
guard. The forever-hang case is committed as `it.skip` with
documentation so a reviewer can verify the bug by hand.
2026-05-20 19:47:30 -04:00
..
debug.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
earlyInput.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
env.ts fix(tui-clipboard): skip native safety net on OSC52-capable terminals (#20954) 2026-05-11 19:40:07 -07:00
envUtils.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
execFileNoThrow.test.ts fix(tui): clipboard copy on linux/wayland 2026-05-20 19:47:30 -04:00
execFileNoThrow.ts fix(tui): clipboard copy on linux/wayland 2026-05-20 19:47:30 -04:00
fullscreen.ts feat: add clicky handles 2026-04-13 21:20:55 -05:00
intl.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
log.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
semver.ts feat: fix types and add type checking plus lazybundle on launch andddd dev flag 2026-04-11 14:42:28 -05:00
sliceAnsi.ts chore(tui): /clean recent perf work — KISS/DRY pass 2026-04-26 20:38:47 -05:00