Skip to content

Commit fb12460

Browse files
committed
Making 3 lines of thinking more robustly stay at 3 lines
1 parent 86cac44 commit fb12460

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cli/src/components/thinking.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ export const Thinking = memo(
2525
const theme = useTheme()
2626
const { contentMaxWidth } = useTerminalDimensions()
2727

28-
const width = Math.max(10, Math.min(availableWidth ?? contentMaxWidth, 120))
28+
const width = Math.max(10, availableWidth ?? contentMaxWidth)
2929
// Normalize content to single line for consistent preview
3030
const normalizedContent = content.replace(/\n+/g, ' ').trim()
31+
// Account for "..." prefix (3 chars) when calculating line widths
32+
const effectiveWidth = width - 3
3133
const { lines, hasMore } = getLastNVisualLines(
3234
normalizedContent,
33-
width,
35+
effectiveWidth,
3436
PREVIEW_LINE_COUNT,
3537
)
3638

@@ -53,12 +55,12 @@ export const Thinking = memo(
5355
<box style={{ paddingLeft: 2 }}>
5456
<text
5557
style={{
56-
wrapMode: 'word',
58+
wrapMode: 'none',
5759
fg: theme.muted,
5860
}}
5961
attributes={TextAttributes.ITALIC}
6062
>
61-
{hasMore ? '...' + lines.join(' ') : lines.join(' ')}
63+
{hasMore ? '...' + lines.join('\n') : lines.join('\n')}
6264
</text>
6365
</box>
6466
)

0 commit comments

Comments
 (0)