From 4aeb9dbc8a50f4a7fbd013d4001ebf3375b1a10d Mon Sep 17 00:00:00 2001 From: fjia Date: Wed, 1 Jul 2026 14:06:08 +0800 Subject: [PATCH] @ fix(app): support slash command picker on any line of multiline input The slash command picker used `rawText.match(/^\/(\S*)$/)` which requires the entire input to start with `/`. This means typing text first, then Shift+Enter, then `/` on a new line would not trigger the picker. Fix by checking only the text before the cursor position for a line-start `/`, matching the same pattern used for @mention triggers. This allows users to compose multiline prompts and trigger slash commands on any line. Fixes #34693 Co-Authored-By: Claude @ --- packages/app/src/components/prompt-input.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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])