disable markdown rendering of shell tool output (#625)

This commit is contained in:
Olcan
2025-05-30 12:43:59 -07:00
committed by GitHub
parent 31a7affb74
commit a0ba65944f
4 changed files with 41 additions and 11 deletions

View File

@@ -72,6 +72,7 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
? 'low'
: 'medium'
}
renderOutputAsMarkdown={tool.renderOutputAsMarkdown}
/>
</Box>
{tool.status === ToolCallStatus.Confirming &&

View File

@@ -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}