From af8462f76dafa423f523d85f758c8b3b6225fd26 Mon Sep 17 00:00:00 2001 From: jacob314 Date: Wed, 25 Feb 2026 09:09:33 -0800 Subject: [PATCH] fix(cli): disable shell autocompletion on completely empty prompts To reduce visual noise and distraction, autocompletion is now suppressed when the shell prompt is entirely empty (or only contains whitespace). It remains active as soon as the user starts typing or moves the cursor to a position that would suggest paths/commands. --- packages/cli/src/ui/hooks/useCommandCompletion.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/cli/src/ui/hooks/useCommandCompletion.tsx b/packages/cli/src/ui/hooks/useCommandCompletion.tsx index 097a1e63b3..45f001dbcd 100644 --- a/packages/cli/src/ui/hooks/useCommandCompletion.tsx +++ b/packages/cli/src/ui/hooks/useCommandCompletion.tsx @@ -115,6 +115,19 @@ export function useCommandCompletion({ const codePoints = toCodePoints(currentLine); if (shellModeActive) { + if (currentLine.trim().length === 0) { + return { + completionMode: CompletionMode.IDLE, + query: null, + completionStart: -1, + completionEnd: -1, + shellTokenIsCommand: false, + shellTokens: [], + shellCursorIndex: -1, + shellCommandToken: '', + }; + } + const tokenInfo = getTokenAtCursor(currentLine, cursorCol); if (tokenInfo) { return {