diff options
| author | Dax Raad <[email protected]> | 2025-11-01 11:10:39 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-11-01 11:10:39 -0400 |
| commit | 1bc3c98ae70e1ce9b07572fa7766b5a4bea240e7 (patch) | |
| tree | 37f3764203de66e66a950b5139dfa4f1d6ed9123 | |
| parent | 55787f2caa1051d1d4a8921a460ac8f7b1f3692d (diff) | |
| download | opencode-1bc3c98ae70e1ce9b07572fa7766b5a4bea240e7.tar.gz opencode-1bc3c98ae70e1ce9b07572fa7766b5a4bea240e7.zip | |
ensure wl-copy is available
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/util/clipboard.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/util/clipboard.ts b/packages/opencode/src/cli/cmd/tui/util/clipboard.ts index 6d4c07dea..7603b4c38 100644 --- a/packages/opencode/src/cli/cmd/tui/util/clipboard.ts +++ b/packages/opencode/src/cli/cmd/tui/util/clipboard.ts @@ -61,7 +61,7 @@ export namespace Clipboard { const getCopyMethod = lazy(() => { const os = platform() - if (os === "darwin") { + if (os === "darwin" && Bun.which("oascript")) { console.log("clipboard: using osascript") return async (text: string) => { const escaped = text.replace(/\\/g, "\\\\").replace(/"/g, '\\"') @@ -70,13 +70,13 @@ export namespace Clipboard { } if (os === "linux") { - if (process.env["WAYLAND_DISPLAY"]) { + if (process.env["WAYLAND_DISPLAY"] && Bun.which("wl-copy")) { console.log("clipboard: using wl-copy") return async (text: string) => { const proc = Bun.spawn(["wl-copy"], { stdin: "pipe", stdout: "ignore", stderr: "ignore" }) proc.stdin.write(text) proc.stdin.end() - await proc.exited + await proc.exited.catch(() => {}) } } if (Bun.which("xclip")) { @@ -117,7 +117,7 @@ export namespace Clipboard { console.log("clipboard: no native support") return async (text: string) => { - await clipboardy.write(text) + await clipboardy.write(text).catch(() => {}) } }) |
