Hacker News new | ask | show | jobs
by arthur_sonzogni 1845 days ago
(Author of FTXUI here)

Yes, that's correct. The whole frame is printed. As said above, as long as you are careful about flickering, this is fine.

This runs very smoothly. So I would say "premature optimization is the root of all evil" for now.

Note that in case of many events sent in a row, we don't render a new frame after every events. We first empty the list of pending events and only render once when it is empty. This ensure there are no lags.

If there is a need, this can be added easily. We just need to ensure this doesn't regress performance. Sending a single chunk representing the whole frame can sometimes be cheaper than sending several diffs at various locations of the screen.

Also, FTXUI support not only rendering to the alternate buffer (fullscreen mode), but it can also render inline. In case of terminal window resize, printing the whole frame avoids garbages to remain, which is nice.