diff --git a/src/components/terminal/commandNavigation.test.ts b/src/components/terminal/commandNavigation.test.ts index 0edd0f4e..98218385 100644 --- a/src/components/terminal/commandNavigation.test.ts +++ b/src/components/terminal/commandNavigation.test.ts @@ -167,5 +167,7 @@ describe("fallback command detection", () => { expect(nextFallbackInteractiveState(true, "\x04", "")).toBe(false); expect(nextFallbackInteractiveState(false, "\r", "ls")).toBe(false); expect(nextFallbackInteractiveState(true, "\r", "exit()")).toBe(false); + expect(nextFallbackInteractiveState(true, "\r", "\\q")).toBe(false); + expect(nextFallbackInteractiveState(true, "\r", ".quit")).toBe(false); }); }); diff --git a/src/components/terminal/commandNavigation.ts b/src/components/terminal/commandNavigation.ts index 1cb09e12..1e9ddf48 100644 --- a/src/components/terminal/commandNavigation.ts +++ b/src/components/terminal/commandNavigation.ts @@ -15,7 +15,9 @@ export function nextFallbackInteractiveState( if (data === "\x04") return false; if (data !== "\r" || !command) return interactive; if (startsObviousInteractiveSession(command)) return true; - if (/^(?:exit|quit|\.exit)(?:\(\))?$/iu.test(command.trim())) return false; + if (/^(?:(?:exit|quit)(?:\(\))?|\.exit|\.quit|\\q)$/iu.test(command.trim())) { + return false; + } return interactive; }