mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 07:03:25 +00:00
fix(tui): reset styles per line
This commit is contained in:
parent
741262d89d
commit
6d495348c5
5 changed files with 37 additions and 0 deletions
|
|
@ -289,6 +289,11 @@ export class TUI extends Container {
|
|||
|
||||
private static readonly SEGMENT_RESET = "\x1b[0m\x1b]8;;\x07";
|
||||
|
||||
private applyLineResets(lines: string[]): string[] {
|
||||
const reset = TUI.SEGMENT_RESET;
|
||||
return lines.map((line) => (this.containsImage(line) ? line : line + reset));
|
||||
}
|
||||
|
||||
/** Splice overlay content into a base line at a specific column. Single-pass optimized. */
|
||||
private compositeLineAt(
|
||||
baseLine: string,
|
||||
|
|
@ -343,6 +348,8 @@ export class TUI extends Container {
|
|||
newLines = this.compositeOverlays(newLines, width, height);
|
||||
}
|
||||
|
||||
newLines = this.applyLineResets(newLines);
|
||||
|
||||
// Width changed - need full re-render
|
||||
const widthChanged = this.previousWidth !== 0 && this.previousWidth !== width;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue