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.
This commit is contained in:
jacob314
2026-02-25 09:09:33 -08:00
parent 2f4242fb60
commit af8462f76d
@@ -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 {