[Urwid] A proper way to clear the screen?

Max E. Kuznecov syhpoon at syhpoon.name
Fri Feb 20 21:11:50 EST 2009


Hi, I wonder what is the proper way to clear the screen after
urwid is initialzed?
What I need is something like mc does - the panels are displayed on the
screen but before command execution the screen must be cleared.

As for now I switch back to saved termios settings using tcsetattr and
then write "\x1b[H\x1b[2J" to stdout (a cl property from termcap for
xterm). It works but I worry about different terminal types with
(possibly) different cl codes.

Maybe it would be more portable if I first clear the screen using urwid
facilities and then go to shell mode, but I've found none in docs.

Thanks.

-- 
~syhpoon




More information about the Urwid mailing list