-
Notifications
You must be signed in to change notification settings - Fork 29
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
extreme flicker when building with many threads #24
Comments
Hey, so I’d first say that this is kinda a known issue. It is caused by the simplistic approach nom takes.
The logic is here: Line 46 in 48d5447
The 20000 means, that we rewrite at most after 0.02s and the 1000000 that we rewrite at the latest after 1s. (threadDelay takes microseconds.) I don‘t know how comfortable you are with Haskell. Maybe you want to play around with tweaking this numbers to see what works better for you? I suspect that going up to 0.05s would probably be no issue. Maybe we can even find a complicated formula where we throttle the output while we are printing more lines. But yeah ncursesery would probably also be an option. |
slowing down updates did not help much at all, the flickering was still there even at one update per second. did find a different fix though that seems to work :) |
I still see a little flickering. The proper solution to this issue is to follow the synchronized updates spec. DECSET/DECRESET should be used instead of BSU/ESU. This basically begins a "transaction" before nom starts modifying the screen and ends it after nom is done. |
@Luflosi the flickering is an annoying topic. In theory the spec says very clearly which drawing events should trigger a redraw and which ones not and I tried painstakingly to trigger as few redraws as possible, but for one there is no way to push lines out-of the terminal at the top without triggering redraws and in my experience many emulators don’t behave consistently and basically redraw whenever they like. Having a way to begin and end a transaction would be fricking awesome. However do you know which terminals support this spec and can we use this in a compatible way for terminals which don’t support it? |
I found https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036 which lists kitty, Alacritty, iTerm2, Wezterm and foot among the terminal emulators that support this. |
I implemented this in #172. This was far more trivial than I thought. Hopefully this fixes flickering in most modern terminals. |
it seems that nom updates its display way too often. builds that produce a lot of output very quickly (eg because they're running on many threads) flicker to the point of being painful to look at, or at the very least unreadable (tested on alacritty and urxvt). not sure whether this can be fixed by just slowing down the output thread or if ncursesery is needed.
The text was updated successfully, but these errors were encountered: