diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 1a25d10f7884..f547d1e41819 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -954,7 +954,8 @@ export const PromptInput: Component = (props) => { if (!shellMode) { const atMatch = rawText.substring(0, cursorPosition).match(/@(\S*)$/) - const slashMatch = rawText.match(/^\/(\S*)$/) + const slashQuery = rawText.substring(0, cursorPosition) + const slashMatch = slashQuery.match(/(?:^|\n)\/(\S*)$/) if (atMatch) { atOnInput(atMatch[1])