-
Notifications
You must be signed in to change notification settings - Fork 850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flickering on Windows when using bubbletea >=0.26.0 #1019
Comments
Okay awesome, thanks for reporting this. There's seems to be a bug in Windows where going in and out of the altscreen will incorrectly fire off a In your case the flickering is happening because of this line, which seems to have been left in by mistake: diff --git a/client/main.go b/client/main.go
index b8fe61a..37b8bd7 100644
--- a/client/main.go
+++ b/client/main.go
@@ -246,7 +246,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.input.Reset()
}
case tea.WindowSizeMsg:
- clCmd = tea.Sequence(tea.ExitAltScreen, tea.EnterAltScreen)
m.history.Height = msg.Height - 2
m.history.Width = msg.Width
m.history.GotoBottom() Of course, |
On Windows, changing the alt-screen-buffer triggers a window-size-event. This might cause issues with some applications. Cache the last window-size-event and compare before sending it the model. Fixes: #1019
🤦 I just have to say thank you so much for digging through and noticing what was wrong with my code. Yes that was left in, from a previous attempt where I thought maybe exiting and re-entering altscreen would cause new Height/Width values to be used. Just tested removing the line and yep, works exactly as expected, including resizing! ❤️ |
On Windows, changing the alt-screen-buffer triggers a window-size-event. This might cause issues with some applications. Cache the last window-size-event and compare before sending it the model. Fixes: #1019
Describe the bug
I tried updating to Bubbletea v0.26.0 (and also .1/.2) but the output seems to flicker a lot when running on Windows.
Setup
Please complete the following information along with version numbers, if applicable.
To Reproduce
I don't have a minimal reproducible example yet, but noticed this while updating dependencies on my project, linked below. Specifically the client binary which uses bubbletea for the UI.
Source Code
Available here: supleed2/go-chat
Expected behavior
Stable output as with v0.25.0, observed with binaries available at: https://github.com/supleed2/go-chat/releases/tag/v0.1.2
Ideally with the new ability to resize :)
Screenshots
GIF to demonstrate:
The text was updated successfully, but these errors were encountered: