fix(coding-agent): fall back to text clipboard paste
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user