diff --git a/src/integrations/terminal/ExecaTerminalProcess.ts b/src/integrations/terminal/ExecaTerminalProcess.ts index d7695bdf6d..1fe9e29278 100644 --- a/src/integrations/terminal/ExecaTerminalProcess.ts +++ b/src/integrations/terminal/ExecaTerminalProcess.ts @@ -60,7 +60,7 @@ export class ExecaTerminalProcess extends BaseTerminalProcess { } catch (error) { if (error instanceof ExecaError) { console.error(`[ExecaTerminalProcess] shell execution error: ${error.message}`) - this.emit("shell_execution_complete", { exitCode: error.exitCode ?? 1, signalName: error.signal }) + this.emit("shell_execution_complete", { exitCode: error.exitCode ?? 0, signalName: error.signal }) } else { this.emit("shell_execution_complete", { exitCode: 1 }) } diff --git a/webview-ui/src/components/chat/CommandExecution.tsx b/webview-ui/src/components/chat/CommandExecution.tsx index f156e39577..7e2acdb492 100644 --- a/webview-ui/src/components/chat/CommandExecution.tsx +++ b/webview-ui/src/components/chat/CommandExecution.tsx @@ -28,7 +28,10 @@ export const CommandExecution = forwardRef(null) - const lines = useMemo(() => output.split("\n").filter((line) => line.trim() !== ""), [output]) + const lines = useMemo( + () => [`$ ${command}`, ...output.split("\n").filter((line) => line.trim() !== "")], + [command, output], + ) const onMessage = useCallback( (event: MessageEvent) => { @@ -61,14 +64,14 @@ export const CommandExecution = forwardRef -
- {command} -
+
+ {command} +
{status?.status === "running" && ( -
+
Running
- {status.pid &&
(PID: {status.pid})
} + {status.pid &&
(PID: {status.pid})
} -
+ )}
-
+
{lines.length > 0 && (