cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Properly clear terminal on Cursive::clear()

Open azat opened this issue 8 months ago • 3 comments

Using buffer.write().clear() over printer.clear() (which is self.buffer.write().fill(" ")) helps with properly clear the cursive screen area after invoking side TUI apps within it (i.e. vim)

Note, that this is not enough to clear the complete screen in case of using ShadowView.

azat avatar Jul 05 '25 20:07 azat

Hi, and thanks for the work!

I'm just concerned that this would cause excessive I/O in most cases. Maybe we need a different function specifically for when another application may have messed up the screen.

gyscos avatar Jul 25 '25 17:07 gyscos

Hi @gyscos!

I will be OK with a separate method, but AFAICS the clear is not a hot path, and usually called explicitly by user

azat avatar Jul 26 '25 14:07 azat

This is an example for a problem - https://github.com/gyscos/cursive/pull/831 (press e then exit from editor and then c - nothing will be cleared), hope this will help

azat avatar Jul 26 '25 14:07 azat