|
|
@@ -731,6 +731,23 @@ export function Prompt(props: PromptProps) {
|
|
|
e.preventDefault()
|
|
|
return
|
|
|
}
|
|
|
+ // Handle clipboard paste (Ctrl+V) - check for images first on Windows
|
|
|
+ // This is needed because Windows terminal doesn't properly send image data
|
|
|
+ // through bracketed paste, so we need to intercept the keypress and
|
|
|
+ // directly read from clipboard before the terminal handles it
|
|
|
+ if (keybind.match("input_paste", e)) {
|
|
|
+ const content = await Clipboard.read()
|
|
|
+ if (content?.mime.startsWith("image/")) {
|
|
|
+ e.preventDefault()
|
|
|
+ await pasteImage({
|
|
|
+ filename: "clipboard",
|
|
|
+ mime: content.mime,
|
|
|
+ content: content.data,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // If no image, let the default paste behavior continue
|
|
|
+ }
|
|
|
if (keybind.match("input_clear", e) && store.prompt.input !== "") {
|
|
|
input.clear()
|
|
|
input.extmarks.clear()
|