mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-22 01:05:06 +01:00
tui: prevent clipboard operations from throwing errors on process exit
This commit is contained in:
@@ -76,7 +76,7 @@ export namespace Clipboard {
|
|||||||
const proc = Bun.spawn(["wl-copy"], { stdin: "pipe", stdout: "ignore", stderr: "ignore" })
|
const proc = Bun.spawn(["wl-copy"], { stdin: "pipe", stdout: "ignore", stderr: "ignore" })
|
||||||
proc.stdin.write(text)
|
proc.stdin.write(text)
|
||||||
proc.stdin.end()
|
proc.stdin.end()
|
||||||
await proc.exited
|
await proc.exited.catch(() => {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Bun.which("xclip")) {
|
if (Bun.which("xclip")) {
|
||||||
@@ -89,7 +89,7 @@ export namespace Clipboard {
|
|||||||
})
|
})
|
||||||
proc.stdin.write(text)
|
proc.stdin.write(text)
|
||||||
proc.stdin.end()
|
proc.stdin.end()
|
||||||
await proc.exited
|
await proc.exited.catch(() => {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Bun.which("xsel")) {
|
if (Bun.which("xsel")) {
|
||||||
@@ -102,7 +102,7 @@ export namespace Clipboard {
|
|||||||
})
|
})
|
||||||
proc.stdin.write(text)
|
proc.stdin.write(text)
|
||||||
proc.stdin.end()
|
proc.stdin.end()
|
||||||
await proc.exited
|
await proc.exited.catch(() => {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user