mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
disable markdown rendering of shell tool output (#625)
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user