mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 04:01:56 +00:00
fix(tui): reduce unnecessary full redraws for better performance
- Remove height change detection (only width changes trigger full redraw) - Change clearOnShrink default to false (use PI_CLEAR_ON_SHRINK=1 to enable) - Fix viewport check to use previousLines.length instead of maxLinesRendered (prevents false positive redraws when appending lines after content shrunk) - Add clearOnShrink setting to /settings in coding-agent - Remove line truncation in custom message component (always show full content)
This commit is contained in:
parent
419c07fb19
commit
0925fafe3b
8 changed files with 80 additions and 48 deletions
|
|
@ -21,6 +21,7 @@ export interface RetrySettings {
|
|||
|
||||
export interface TerminalSettings {
|
||||
showImages?: boolean; // default: true (only relevant if terminal supports images)
|
||||
clearOnShrink?: boolean; // default: false (clear empty rows when content shrinks)
|
||||
}
|
||||
|
||||
export interface ImageSettings {
|
||||
|
|
@ -628,6 +629,23 @@ export class SettingsManager {
|
|||
this.save();
|
||||
}
|
||||
|
||||
getClearOnShrink(): boolean {
|
||||
// Settings takes precedence, then env var, then default false
|
||||
if (this.settings.terminal?.clearOnShrink !== undefined) {
|
||||
return this.settings.terminal.clearOnShrink;
|
||||
}
|
||||
return process.env.PI_CLEAR_ON_SHRINK === "1";
|
||||
}
|
||||
|
||||
setClearOnShrink(enabled: boolean): void {
|
||||
if (!this.globalSettings.terminal) {
|
||||
this.globalSettings.terminal = {};
|
||||
}
|
||||
this.globalSettings.terminal.clearOnShrink = enabled;
|
||||
this.markModified("terminal", "clearOnShrink");
|
||||
this.save();
|
||||
}
|
||||
|
||||
getImageAutoResize(): boolean {
|
||||
return this.settings.images?.autoResize ?? true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue