renderer: ignore invalid terminal dimensions (#1440)

Prevent resize signals with unavailable terminal dimensions from
resetting the renderer to an arbitrary 80x24 fallback.

Supersede #687
This commit is contained in:
Simon Klee authored and GitHub committed 2026-08-26 10:50:26 +02:00
1 parent 465c3ccad0
commit 352c1fc59b
1 file changed
+3 -3
+3 -3
View File
@@ -897,9 +897,9 @@ export class CliRenderer extends EventEmitter implements RenderContext {
private _useConsole: boolean = true
private sigwinchHandler: () => void = (() => {
const width = this.stdout.columns || 80
const height = this.stdout.rows || 24
this.handleResize(width, height)
const width = this.stdout.columns
const height = this.stdout.rows
if (width > 0 && height > 0) this.handleResize(width, height)
}).bind(this)
private _capabilities: TerminalCapabilities | null = null
private _latestPointer: { x: number; y: number } = { x: 0, y: 0 }