@@ -32,6 +32,19 @@ function wrapText(text: string, width: number): string[] {
3232 return text.split("\n").flatMap((line) => wrapLine(line, width));
3333 }
3434
35+interface LiveRow {
36+ text: string;
37+ dim: boolean;
38+}
39+
40+function wrapStyled(text: string, width: number, dim: boolean): LiveRow[] {
41+ return wrapText(text, width).map((line) => ({ text: line, dim }));
42+}
43+
44+function dim(text: string): string {
45+ return `\x1b[2m${text}\x1b[22m`;
46+}
47+
3548 function tail(text: string): string {
3649 return text.length > MAX_LIVE_CHARS ? text.slice(text.length - MAX_LIVE_CHARS) : text;
3750 }
@@ -73,11 +86,11 @@ class LiveRegion {
7386 return out;
7487 }
7588
76- draw(lines: string[], cursorRow: number, cursorCol: number): string {
89+ draw(lines: LiveRow[], cursorRow: number, cursorCol: number): string {
7790 let out = this.clear();
7891 for (let i = 0; i < lines.length; i++) {
7992 if (i > 0) out += "\r\n";
80- out += lines[i];
93+ out += lines[i].dim ? dim(lines[i].text) : lines[i].text;
8194 }
8295 const up = lines.length - 1 - cursorRow;
8396 if (up > 0) out += `\x1b[${up}A`;
@@ -315,7 +328,7 @@ class Tui {
315328 const parts: string[] = [];
316329 for (const block of message.content) {
317330 if (block.type === "thinking") {
318- if (block.thinking.trim()) parts.push(block.thinking.trimEnd());
331+ if (block.thinking.trim()) parts.push(dim(block.thinking.trimEnd()));
319332 } else if (block.type === "text") {
320333 if (block.text.trim()) parts.push(block.text.trimEnd());
321334 } else if (block.type === "toolCall") {
@@ -352,13 +365,13 @@ class Tui {
352365 if (this.closed) return;
353366 const width = Math.max(1, this.term.width);
354367 const maxLive = Math.max(1, Math.min(MAX_LIVE_ROWS, this.term.height - 1));
355- const content: string[] = [];
356- if (this.reasoning) content.push(...wrapText(this.reasoning, width));
357- if (this.answer) content.push(...wrapText(this.answer, width));
358- if (this.toolOutput) content.push(...wrapText(this.toolOutput, width));
359- const status = wrapText(`[${this.status}]`, width);
368+ const all: LiveRow[] = [];
369+ if (this.reasoning) all.push(...wrapStyled(this.reasoning, width, true));
370+ if (this.answer) all.push(...wrapStyled(this.answer, width, false));
371+ if (this.toolOutput) all.push(...wrapStyled(this.toolOutput, width, false));
372+ all.push(...wrapStyled(`[${this.status}]`, width, true));
360373 const editor = this.editor.render(width);
361- const all = [...content, ...status, ...editor.rows];
374+ for (const row of editor.rows) all.push({ text: row, dim: false });
362375 const shown = all.slice(-maxLive);
363376 const editorOffset = all.length - editor.rows.length;
364377 const shownOffset = all.length - shown.length;