Skip to content

Commit

Permalink
Do not try to print anything is screen height is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Jan 2, 2025
1 parent e5cfc98 commit 543d41f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 543d41f

Please sign in to comment.