[GH-ISSUE #401] [Windows] Resize event not sending updated width and height #294

Closed
opened 2026-03-04 01:03:41 +03:00 by kerem · 2 comments
Owner

Originally created by @kvnxiao on GitHub (Feb 12, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/401

Compiling any of the demos on windows and trying to run the exe both directly and through cmd, powershell, and Windows Terminal, the UI does not refresh after resizing at all!

I have to manually press a key for the UI to refresh.

Editing application.go and adding screen.Sync() before newWidth, newHeight := screen.Size() seems to fix it?

Not sure exactly why this issue is happening?

Originally created by @kvnxiao on GitHub (Feb 12, 2020). Original GitHub issue: https://github.com/rivo/tview/issues/401 Compiling any of the demos on windows and trying to run the exe both directly and through cmd, powershell, and Windows Terminal, the UI does not refresh after resizing at all! I have to manually press a key for the UI to refresh. Editing `application.go` and adding `screen.Sync()` before `newWidth, newHeight := screen.Size()` seems to fix it? Not sure exactly why this issue is happening?
kerem closed this issue 2026-03-04 01:03:41 +03:00
Author
Owner

@tslocum commented on GitHub (Feb 15, 2020):

According to the tcell docs on Screen.Size:

Size returns the screen size as width, height. This changes in response to a call to Clear or Flush.

Clear was not being called before retrieving the new screen size. I've submitted a PR to resolve this.

<!-- gh-comment-id:586614546 --> @tslocum commented on GitHub (Feb 15, 2020): According to the tcell docs on [Screen.Size](https://github.com/gdamore/tcell/blob/2fca0432ba2d854410ab0a63d7d6f3f9ce3a5e48/screen.go#L77): > Size returns the screen size as width, height. This changes in response to a call to Clear or Flush. Clear was not being called before retrieving the new screen size. I've submitted a PR to resolve this.
Author
Owner

@rivo commented on GitHub (Aug 18, 2020):

I made the change that @tslocum suggested. This will hopefully solve your problem. If not, please open a new issue. (I might not see it here anymore.)

<!-- gh-comment-id:675395860 --> @rivo commented on GitHub (Aug 18, 2020): I made the change that @tslocum suggested. This will hopefully solve your problem. If not, please open a new issue. (I might not see it here anymore.)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#294
No description provided.