Re: curses suite of modules

Ken Manheimer (ken.manheimer@nist.gov)
Tue, 13 Sep 94 12:16:39 EDT

I've got a couple of questions/items re the curses modules.

First of all, thanks much to lance for producing the packages...

In order to build the dynamic-load module on SunOS 4.1.3, i need to do
a few things differently than the way that is prescribed in the
Setup.curses delivered with the packages. I'm wondering whether other
people have seen the same behaviors.

I need to use the System V compatability packages to do compile and
load it, and use the termcap library in addition to the curses
library. Ie, i need to compile with "-I/usr/5include", and load with
"-L/usr/5lib -lcurses -ltermcap". Have other people had the same
experience? If so, it would probably make sense to somehow
incorporate the information in the distribution.

I'm unable to build the "panel" module at all - i don't see any
panel.h include files on my system, or a libpanel.* in the regular or
System V compatability libraries. Is the panel feature specific to
some other OS? Or might the routines for it be available in my OS,
but in a library with a different name?

I've encountered two problems with the way the curses package behaves.

The first is fairly straightforward - the .initscr() module method
will, as documented, exit the parent program if it is invoked on a
terminal that is not curses capable. If i understand correctly, the
curses solution is to use the newscr() routine, which does not do the
_exit if it is not successful. The problem is that screens are not
yet implemented in the curses module, and i can't see a way to test
for curses-capability without risking the initscr() method. ?

Finally, i see a weird and troublesome behavior of nodelay-reads
within curses. If i invoke the win.nodelay(1) method and then a
win.getch(), python exits *and* the tty session exits! It looks like
the tty gets set overall to nodelay, and immediately sees an EOF
condition (if there is no prior input pending), all the way up the
line. Does anyone else see this behavior, and does anyone have
suggestions for preventing it??

Here's a transcript fragment which exhibits the behavior:

>>> import curses
>>> w = curses.initscr()
>>> w.nodelay(1)
>>> w.getch()
-1
>>> # python exits
shell prompt % logout # shell exits!

(If you want to try this, make sure you won't miss the shell you do it
in, just in case you do encounter the problem.)

Suggestions and comments are welcome...

Ken
ken.manheimer@nist.gov, 301 975-3539