From a0ba65944fd1f940c161e7bb2aa7f01f62ae1c15 Mon Sep 17 00:00:00 2001
From: Olcan <olcans@gmail.com>
Date: Fri, 30 May 2025 12:43:59 -0700
Subject: disable markdown rendering of shell tool output (#625)

---
 .../cli/src/ui/components/messages/ToolMessage.tsx | 27 ++++++++++++++--------
 1 file changed, 18 insertions(+), 9 deletions(-)

(limited to 'packages/cli/src/ui/components/messages/ToolMessage.tsx')

diff --git a/packages/cli/src/ui/components/messages/ToolMessage.tsx b/packages/cli/src/ui/components/messages/ToolMessage.tsx
index 51d3dffb..0cb5a101 100644
--- a/packages/cli/src/ui/components/messages/ToolMessage.tsx
+++ b/packages/cli/src/ui/components/messages/ToolMessage.tsx
@@ -21,6 +21,7 @@ export type TextEmphasis = 'high' | 'medium' | 'low';
 export interface ToolMessageProps extends IndividualToolCallDisplay {
   availableTerminalHeight: number;
   emphasis?: TextEmphasis;
+  renderOutputAsMarkdown?: boolean;
 }
 
 export const ToolMessage: React.FC<ToolMessageProps> = ({
@@ -30,6 +31,7 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
   status,
   availableTerminalHeight,
   emphasis = 'medium',
+  renderOutputAsMarkdown = true,
 }) => {
   const contentHeightEstimate =
     availableTerminalHeight - STATIC_HEIGHT - RESERVED_LINE_COUNT;
@@ -76,15 +78,22 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
                 </Text>
               </Box>
             )}
-            {typeof displayableResult === 'string' && (
-              <Box flexDirection="column">
-                <MarkdownDisplay
-                  text={displayableResult}
-                  isPending={false}
-                  availableTerminalHeight={availableTerminalHeight}
-                />
-              </Box>
-            )}
+            {typeof displayableResult === 'string' &&
+              renderOutputAsMarkdown && (
+                <Box flexDirection="column">
+                  <MarkdownDisplay
+                    text={displayableResult}
+                    isPending={false}
+                    availableTerminalHeight={availableTerminalHeight}
+                  />
+                </Box>
+              )}
+            {typeof displayableResult === 'string' &&
+              !renderOutputAsMarkdown && (
+                <Box flexDirection="column">
+                  <Text>{displayableResult}</Text>
+                </Box>
+              )}
             {typeof displayableResult !== 'string' && (
               <DiffRenderer
                 diffContent={displayableResult.fileDiff}
-- 
cgit v1.2.3

