fix: centralize OSC 52 clipboard support for SSH sessions (#8974)

This commit is contained in:
b3nw
2026-01-16 16:57:17 -06:00
committed by GitHub
parent 632f20558a
commit 3d095e7fe7
4 changed files with 16 additions and 20 deletions

View File

@@ -697,11 +697,6 @@ export function Session() {
return
}
const base64 = Buffer.from(text).toString("base64")
const osc52 = `\x1b]52;c;${base64}\x07`
const finalOsc52 = process.env["TMUX"] ? `\x1bPtmux;\x1b${osc52}\x1b\\` : osc52
/* @ts-expect-error */
renderer.writeOut(finalOsc52)
Clipboard.copy(text)
.then(() => toast.show({ message: "Message copied to clipboard!", variant: "success" }))
.catch(() => toast.show({ message: "Failed to copy to clipboard", variant: "error" }))