Replies: 2 comments 7 replies
-
Hi @tombh Glad you like Rich. I have had a report that here is flickering in tmux, but I haven't looked in to it. Live does write the whole screen each time. It would be possible to calculate the deltas, but that's probably easier done at the Segment level in Rich (an intermediate data structure before it generates ansi codes). I'm working on another project which is more aimed at dynamic interfaces, which is capable of only updating changed portions of the screen. But that's not ready yet. Browsh looks awesome, BTW. Going to have a play with that. |
Beta Was this translation helpful? Give feedback.
-
Thanks about Browsh 🤓 I've actually found the flickering problem seems to have more to do with my terminal, Alacritty, as I've found that Kitty has no problem rendering my rich.live dashboard in tmux. Great news about the textual project, it'll have/has good input support as well I suppose, so I'll definitely want to use that. |
Beta Was this translation helpful? Give feedback.
-
Firstly I really like this project, I've been using it as a monitor dashboard in a production app and it's helped surface some significant bugs in my own code, so thank you.
One minor problem I have is flickering in tmux. I'm using
rich.live
and have tried various refresh rates and sleeps, etc. There's zero flickering outside of tmux (in a plain Alacritty terminal) so I'm assuming that tmux is just not as efficient at rendering. From a cursory look at rich's code it seems thatLive
(or would it beLayout
's responsibility?) redraws the entire frame/screen, rather than the perhaps more convoluted method of just updating what's changed.In theory, rendering changes between 2 TTY states could be achieved by a standalone program, eg;
./my_rich_app.py | tty_updater
. I would actually be interested in writing that program as it would be useful for Browsh (a terminal-based web browser) I maintain. Oh I just realised, that's not so straight forward because you'd have to detect both the moment of screen clearing and the end of the frame rendering, so it would only work in the narrow case of apps that redraw the entire TTY, but then that's also the only use case you'd want diffed rendering 🤔Or maybe I'm just mistaken about the source of the flickering. Or maybe it wouldn't be too hard to implement in rich, if so I might be able to PR it.
Beta Was this translation helpful? Give feedback.
All reactions