peterbrittain / asciimatics

A cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations
Apache License 2.0
3.64k stars 238 forks source link

Screen.redraw() for drawing entire screen (not just changes like in Screen.refresh) #280

Closed kfmfe04 closed 3 years ago

kfmfe04 commented 3 years ago

Screen.refresh() only draws changes.

To reproduce, run byobu-tmux on one machine and close the terminal. Restart byobu-tmux on a new machine. On the new machine, this is insufficient (the entire screen is blanked out, but only the refreshed areas are drawn).

It would be nice to have a feature like Screen.redraw() which will draw all the elements on the screen, not just the changes. I can bind a key to Screen.redraw() and resolve the problem described above.

peterbrittain commented 3 years ago

This is working by design. Asciimatics maintains a double buffer in order to just draw changes as needed.

To be honest, this sounds like a bug in byobu... If it is maintaining a full screen buffer for any embedded terminals, why hasn't it redrawn that on the new connection? Do you see similar problems with other full-screen terminal applications run in the same way? If so, it might be worth asking the maintainers what they can do here...

However, if you can't get anywhere with them, I'd be happy to take a PR to create a new method on Screen that forces a full update. Maybe a new optional parameter on the existing force_update method that clears the double buffer and so forces a full redraw on the next refresh?

peterbrittain commented 3 years ago

Any joy?

peterbrittain commented 3 years ago

Implementation of #286 will have to provide this, so closing this request now. Work will be tracked in the other issue.