Skip to content

Commit

Permalink
fix crash if window resizes to zero dimensions
Browse files Browse the repository at this point in the history
Suggested by crodeus on the tcell Discord.
  • Loading branch information
gdamore committed Jan 7, 2024
1 parent 337e381 commit 45f68a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions console_win.go
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@ func (s *cScreen) resize() {
return
}

// Ignore resize if the console dimensions are invalid.
if s.w == 0 || s.h == 0 {
return
}

s.cells.Resize(w, h)
s.w = w
s.h = h
Expand Down

0 comments on commit 45f68a5

Please sign in to comment.