fix(tui): skip Termux height redraws closes #2467
This commit is contained in:
@@ -107,6 +107,10 @@ function parseSizeValue(value: SizeValue | undefined, referenceSize: number): nu
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function isTermuxSession(): boolean {
|
||||
return Boolean(process.env.TERMUX_VERSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for overlay positioning and sizing.
|
||||
* Values can be absolute numbers or percentage strings (e.g., "50%").
|
||||
@@ -937,9 +941,18 @@ export class TUI extends Container {
|
||||
return;
|
||||
}
|
||||
|
||||
// Width or height changed - full re-render
|
||||
if (widthChanged || heightChanged) {
|
||||
logRedraw(`terminal size changed (${this.previousWidth}x${this.previousHeight} -> ${width}x${height})`);
|
||||
// Width changes always need a full re-render because wrapping changes.
|
||||
if (widthChanged) {
|
||||
logRedraw(`terminal width changed (${this.previousWidth} -> ${width})`);
|
||||
fullRender(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Height changes normally need a full re-render to keep the visible viewport aligned,
|
||||
// but Termux changes height when the software keyboard shows or hides.
|
||||
// In that environment, a full redraw causes the entire history to replay on every toggle.
|
||||
if (heightChanged && !isTermuxSession()) {
|
||||
logRedraw(`terminal height changed (${this.previousHeight} -> ${height})`);
|
||||
fullRender(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user