Elffuss BraidHub

kikocis/continue public

Merge pull request #7641 from continuedev/tingwai/con-3774-cli-exit-slash-command

fix: cli /exit and ctrl-d actually exits
Changesetd1aa4d88968159ab0c55a1b2afd9aa2862317afa9aefc5af807bd7ee3251ee4c
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-08 16:27 -07:00
CommitterGitHub <noreply@github.com> · 2025-09-08 16:27 -07:00
Parents41d2e879b49a, f004f777ead7

Browse the files at this changeset

4 files changed

modified extensions/cli/src/ui/hooks/useChat.clear.test.ts +0 −6
@@ -15,7 +15,6 @@
1515
1616 describe("useChat clear command", () => {
1717 let mockSetChatHistory: ReturnType<typeof vi.fn>;
18- let mockExit: ReturnType<typeof vi.fn>;
1918 let mockOnClear: ReturnType<typeof vi.fn>;
2019
2120 beforeEach(() => {
@@ -23,7 +22,6 @@
2322 vi.clearAllMocks();
2423
2524 mockSetChatHistory = vi.fn();
26- mockExit = vi.fn();
2725 mockOnClear = vi.fn();
2826 });
2927
@@ -44,7 +42,6 @@
4442 result,
4543 chatHistory,
4644 setChatHistory: mockSetChatHistory,
47- exit: mockExit,
4845 onShowConfigSelector: vi.fn(),
4946 onClear: mockOnClear,
5047 });
@@ -91,7 +88,6 @@
9188 result,
9289 chatHistory,
9390 setChatHistory: mockSetChatHistory,
94- exit: mockExit,
9591 onShowConfigSelector: vi.fn(),
9692 // onClear is not provided
9793 });
@@ -127,7 +123,6 @@
127123 result,
128124 chatHistory,
129125 setChatHistory: mockSetChatHistory,
130- exit: mockExit,
131126 onShowConfigSelector: vi.fn(),
132127 onClear: mockOnClear,
133128 });
@@ -149,7 +144,6 @@
149144 result,
150145 chatHistory,
151146 setChatHistory: mockSetChatHistory,
152- exit: mockExit,
153147 onShowConfigSelector: vi.fn(),
154148 onClear: mockOnClear,
155149 });
modified extensions/cli/src/ui/hooks/useChat.helpers.ts +1 −4
@@ -46,7 +46,6 @@
4646 result: SlashCommandResult;
4747 chatHistory: ChatHistoryItem[];
4848 setChatHistory: React.Dispatch<React.SetStateAction<ChatHistoryItem[]>>;
49- exit: () => void;
5049 onShowConfigSelector: () => void;
5150 onShowModelSelector?: () => void;
5251 onShowMCPSelector?: () => void;
@@ -61,7 +60,6 @@
6160 result,
6261 chatHistory,
6362 setChatHistory,
64- exit,
6563 onShowConfigSelector,
6664 onShowModelSelector,
6765 onShowMCPSelector,
@@ -69,8 +67,7 @@
6967 onClear,
7068 }: ProcessSlashCommandResultOptions): string | null {
7169 if (result.exit) {
72- exit();
73- return null;
70+ process.exit(0);
7471 }
7572
7673 if (result.openMcpSelector) {
modified extensions/cli/src/ui/hooks/useChat.ts +0 −1
@@ -370,7 +370,6 @@
370370 result: commandResult,
371371 chatHistory,
372372 setChatHistory,
373- exit,
374373 onShowConfigSelector,
375374 onShowModelSelector,
376375 onShowMCPSelector,
modified extensions/cli/src/ui/hooks/useUserInput.ts +1 −1
@@ -76,7 +76,7 @@
7676 // Handle Ctrl+D to exit
7777 if (key.ctrl && input === "d") {
7878 exit();
79- return true;
79+ process.exit(0);
8080 }
8181
8282 // Handle Ctrl+L to refresh screen (clear terminal artifacts)