Skip to content

Commit

Permalink
stop handling output on cols/rows change
Browse files Browse the repository at this point in the history
  • Loading branch information
figuerom16 committed Jan 10, 2024
1 parent 3b59c35 commit 11589dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,15 @@ func (t *Terminal) handleOutput(buf []byte) []byte {
size int
r rune
i = -1
cols = t.config.Columns
rows = t.config.Rows
)
for {
// check if terminal size has changed
if t.config.Columns != cols || t.config.Rows != rows {
break
}

i++
buf = buf[size:]
r, size = utf8.DecodeRune(buf)
Expand Down

0 comments on commit 11589dc

Please sign in to comment.