mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 22:01:41 +00:00
Fix TUI rendering with wrong dimensions after suspend/resume
- Send SIGWINCH to self on terminal start to refresh stale dimensions (Unix only) - Change requestRender(true) to set previousWidth = -1 to trigger widthChanged - Update first render condition to skip when widthChanged is true Fixes #599
This commit is contained in:
parent
019ad0ec11
commit
d7394eb109
3 changed files with 13 additions and 3 deletions
|
|
@ -164,7 +164,7 @@ export class TUI extends Container {
|
|||
requestRender(force = false): void {
|
||||
if (force) {
|
||||
this.previousLines = [];
|
||||
this.previousWidth = 0;
|
||||
this.previousWidth = -1; // -1 triggers widthChanged, forcing a full clear
|
||||
this.cursorRow = 0;
|
||||
}
|
||||
if (this.renderRequested) return;
|
||||
|
|
@ -334,8 +334,8 @@ export class TUI extends Container {
|
|||
// Width changed - need full re-render
|
||||
const widthChanged = this.previousWidth !== 0 && this.previousWidth !== width;
|
||||
|
||||
// First render - just output everything without clearing
|
||||
if (this.previousLines.length === 0) {
|
||||
// First render - just output everything without clearing (assumes clean screen)
|
||||
if (this.previousLines.length === 0 && !widthChanged) {
|
||||
let buffer = "\x1b[?2026h"; // Begin synchronized output
|
||||
for (let i = 0; i < newLines.length; i++) {
|
||||
if (i > 0) buffer += "\r\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue