fix(coding-agent): fall back to text clipboard paste

This commit is contained in:
Armin Ronacher
2026-07-10 21:46:15 +02:00
parent 3b686ac224
commit d7a48d30a0
10 changed files with 61 additions and 22 deletions
@@ -32,6 +32,20 @@ function emitOsc52(text: string): boolean {
return true;
}
/** Read plain text from the system clipboard, if native clipboard access is available. */
export async function readClipboardText(): Promise<string | null> {
if (!clipboard) {
return null;
}
try {
const text = await clipboard.getText();
return text || null;
} catch {
return null;
}
}
export async function copyToClipboard(text: string): Promise<void> {
let copied = false;