feat(coding-agent): add Android/Termux support

- Make @mariozechner/clipboard an optional dependency
- Lazy-load clipboard module with graceful fallback
- Add Termux clipboard support via termux-clipboard-set
- Skip image clipboard on Termux (not supported)

fixes #1164
This commit is contained in:
Mario Zechner 2026-02-01 22:59:11 +01:00
parent bc3fda518d
commit cb850676e7
3 changed files with 33 additions and 4 deletions

View file

@ -17,7 +17,16 @@ export function copyToClipboard(text: string): void {
} else if (p === "win32") {
execSync("clip", options);
} else {
// Linux - try wl-copy for Wayland, fall back to xclip/xsel for X11
// Linux. Try Termux, Wayland, or X11 clipboard tools.
if (process.env.TERMUX_VERSION) {
try {
execSync("termux-clipboard-set", options);
return;
} catch {
// Fall back to Wayland or X11 tools.
}
}
const isWayland = isWaylandSession();
if (isWayland) {
try {