Do not try to print anything is screen height is zero

This commit is contained in:
Junegunn Choi 2025-01-02 23:44:47 +09:00
parent e5cfc988ec
commit 543d41f3dd
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -1918,6 +1918,10 @@ func (t *Terminal) printLabel(window tui.Window, render labelPrinter, opts label
return
}
if window.Height() == 0 {
return
}
switch borderShape {
case tui.BorderHorizontal, tui.BorderTop, tui.BorderBottom, tui.BorderRounded, tui.BorderSharp, tui.BorderBold, tui.BorderBlock, tui.BorderThinBlock, tui.BorderDouble:
if redrawBorder {
@ -2055,7 +2059,7 @@ func (t *Terminal) printInfo() {
}
func (t *Terminal) printInfoImpl() {
if t.window.Width() <= 1 {
if t.window.Width() <= 1 || t.window.Height() == 0 {
return
}
pos := 0