From 8a70b98d1dd492c645b828a2e180a66e1c20d5cd Mon Sep 17 00:00:00 2001 From: Olcan Date: Wed, 21 May 2025 09:00:54 -0700 Subject: fix exit code for shell mode also (#466) --- packages/cli/src/ui/hooks/shellCommandProcessor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/cli/src/ui/hooks/shellCommandProcessor.ts') diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.ts index 35935e7d..ae8367d6 100644 --- a/packages/cli/src/ui/hooks/shellCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/shellCommandProcessor.ts @@ -43,7 +43,7 @@ export const useShellCommandProcessor = ( const pwdFilePath = path.join(os.tmpdir(), pwdFileName); if (!commandToExecute.endsWith('&')) commandToExecute += ';'; // note here we could also restore a previous pwd with `cd {cwd}; { ... }` - commandToExecute = `{ ${commandToExecute} }; pwd >${pwdFilePath}`; + commandToExecute = `{ ${commandToExecute} }; __code=$?; pwd >${pwdFilePath}; exit $__code`; const userMessageTimestamp = Date.now(); addItemToHistory( -- cgit v1.2.3