mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
disable markdown rendering of shell tool output (#625)
This commit is contained in:
parent
31a7affb74
commit
a0ba65944f
4 changed files with 41 additions and 11 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue