Replacing curses

Ian Ward ian at excess.org
Wed Feb 8 12:10:16 EST 2006


Thomas Dickey wrote:
> hmm - I've read Urwid, and most of the comments I've read in that regard
> reflect problems in Urwid.  Perhaps it's time for you to do a little analysis.
> 
> (looking forward to bug reports, rather than line noise)

A fair request.  My appologies for the inflammatory subject :-)

When trying to check for user input without waiting I use code like:
window_object.nodelay(1)
curses.cbreak()
input = window_object.getch()

Occasionally (hard to reproduce reliably) the cbreak() call will raise
an exception, but if I call it a second time before calling getch the
code will work properly.  This problem might be related to a signal
interrupting the function call, I'm not sure.

Also, screen resizing only seems to be reported once by getch() even if
the user continues to resize the window.  I have worked around this by
calling curses.doupdate() between calls to getch(). Maybe this is by design?

Finally, the curses escape sequence detection could be broadened. The
top part of the curses_display module in Urwid defines many escape
sequences I've run into that curses doesn't detect.

Ian Ward





More information about the Python-list mailing list