mirror of
https://github.com/aphrody-labs/opentui.git
synced 2026-10-13 21:08:53 +00:00
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:
1 parent
465c3ccad0
commit
352c1fc59b
1 file changed
+3
-3
@@ -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 }
|
||||
|
||||
Reference in new issue
Block a user