diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index 2d99051fb97..7ded22e04e2 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -943,9 +943,8 @@ export function Prompt(props: PromptProps) { return } - // trim ' from the beginning and end of the pasted content. just - // ' and nothing else - const filepath = pastedContent.replace(/^'+|'+$/g, "").replace(/\\ /g, " ") + // strip shell quoting/escaping that terminals add when drag-dropping file paths + const filepath = pastedContent.replace(/^'+|'+$/g, "").replace(/\\([^a-zA-Z0-9])/g, "$1") const isUrl = /^(https?):\/\//.test(filepath) if (!isUrl) { try {