Fix #4822: let xclip exit

This commit is contained in:
Oliver Blanthorn 2026-07-25 21:38:51 +02:00
parent b75db50a5f
commit 8dd6e14550
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -465,7 +465,11 @@ export async function clipboard(
} else if (action === "set") {
const required_version = "0.1.7"
if (await nativegate(required_version, false)) {
const result = await run(`${clipcmd} -i`, str)
const nullDevice =
(await browserBg.runtime.getPlatformInfo()).os === "win"
? "NUL"
: "/dev/null"
const result = await run(`${clipcmd} -i >${nullDevice} 2>&1`, str)
if (result.code !== 0)
throw new Error(
`External command failed with code ${result.code}: ${clipcmd}`,