File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ interface TerminalCommandDisplayProps {
2020 cwd ?: string
2121 /** Timeout in seconds for the command */
2222 timeoutSeconds ?: number
23+ /** Optional width override for wrapping calculations */
24+ availableWidth ?: number
2325}
2426
2527/**
@@ -33,10 +35,10 @@ export const TerminalCommandDisplay = ({
3335 maxVisibleLines,
3436 isRunning = false ,
3537 timeoutSeconds,
38+ availableWidth,
3639} : TerminalCommandDisplayProps ) => {
3740 const theme = useTheme ( )
38- const { contentMaxWidth } = useTerminalDimensions ( )
39- const padding = 5
41+ const { separatorWidth } = useTerminalDimensions ( )
4042 const [ isExpanded , setIsExpanded ] = useState ( false )
4143
4244 // Default max lines depends on whether expandable
@@ -77,7 +79,7 @@ export const TerminalCommandDisplay = ({
7779 }
7880
7981 // With output - calculate visual lines
80- const width = Math . max ( 10 , contentMaxWidth - padding * 2 )
82+ const width = Math . max ( 10 , availableWidth ?? separatorWidth )
8183 const allLines = output . split ( '\n' )
8284
8385 // Calculate total visual lines across all output lines
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export const parseTerminalOutput = (rawOutput: string | undefined): ParsedTermin
4949export const RunTerminalCommandComponent = defineToolComponent ( {
5050 toolName : 'run_terminal_command' ,
5151
52- render ( toolBlock ) : ToolRenderConfig {
52+ render ( toolBlock , _theme , options ) : ToolRenderConfig {
5353 // Extract command and timeout from input
5454 const input = toolBlock . input as { command ?: string ; timeout_seconds ?: number } | undefined
5555 const command = typeof input ?. command === 'string' ? input . command . trim ( ) : ''
@@ -67,6 +67,7 @@ export const RunTerminalCommandComponent = defineToolComponent({
6767 maxVisibleLines = { 5 }
6868 cwd = { startingCwd }
6969 timeoutSeconds = { timeoutSeconds }
70+ availableWidth = { options . availableWidth }
7071 />
7172 )
7273
You can’t perform that action at this time.
0 commit comments