diff --git a/packages/ui/src/components/prompt-input.tsx b/packages/ui/src/components/prompt-input.tsx index 331f064e..ab4bb636 100644 --- a/packages/ui/src/components/prompt-input.tsx +++ b/packages/ui/src/components/prompt-input.tsx @@ -844,7 +844,10 @@ export default function PromptInput(props: PromptInputProps) { const currentPrompt = prompt() const pos = atPosition() const cursorPos = textareaRef?.selectionStart || 0 - const folderMention = relativePath === "." || relativePath === "" ? "/" : displayPath + const folderMention = + relativePath === "." || relativePath === "" + ? "/" + : relativePath.replace(/\/+$/, "") + "/" if (pos !== null) { const before = currentPrompt.substring(0, pos + 1) @@ -888,7 +891,7 @@ export default function PromptInput(props: PromptInputProps) { if (pos !== null) { const before = currentPrompt.substring(0, pos) const after = currentPrompt.substring(cursorPos) - const attachmentText = `@${filename}` + const attachmentText = `@${normalizedPath}` const newPrompt = before + attachmentText + " " + after setPrompt(newPrompt)