refactor(shell): Send AnsiOutput when ShowColor is false (#8647)

This commit is contained in:
Gal Zahavi
2025-09-18 13:04:46 -07:00
committed by GitHub
parent 899b6f72cb
commit a34e375193
4 changed files with 120 additions and 41 deletions
@@ -58,6 +58,11 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
ptyId === activeShellPtyId &&
shellFocused;
const isThisShellFocusable =
(name === SHELL_COMMAND_NAME || name === 'Shell') &&
status === ToolCallStatus.Executing &&
config?.getShouldUseNodePtyShell();
const availableHeight = availableTerminalHeight
? Math.max(
availableTerminalHeight - STATIC_HEIGHT - RESERVED_LINE_COUNT,
@@ -90,9 +95,11 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
description={description}
emphasis={emphasis}
/>
{isThisShellFocused && (
<Box marginLeft={1}>
<Text color={theme.text.accent}>[Focused]</Text>
{isThisShellFocusable && (
<Box marginLeft={1} flexShrink={0}>
<Text color={theme.text.accent}>
{isThisShellFocused ? '(Focused)' : '(ctrl+f to focus)'}
</Text>
</Box>
)}
{emphasis === 'high' && <TrailingIndicator />}
@@ -118,7 +125,7 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
</Box>
</MaxSizedBox>
) : typeof resultDisplay === 'object' &&
!Array.isArray(resultDisplay) ? (
'fileDiff' in resultDisplay ? (
<DiffRenderer
diffContent={resultDisplay.fileDiff}
filename={resultDisplay.fileName}