rbraun@spdcc.COM (Rich Braun) (06/14/91)
I've started developing an application which uses Unix curses, and it has to run with a variety of terminals on a variety of systems (SCO Unix, NCR Tower, IBM RS/6000, etc). I've run into a couple of "gotchas" which are causing me to rethink my decision to use curses, perhaps forcing me to write my own code and my orm terminfo files. The first is that SCO appears to be shipping (with 3.2v2) an incorrect terminfo.src file. For the worlds-most-common-terminal, the vt100, it defines the keypad arrow keys ('kcuu1') as the sequences <ESC>OA etc. In order to get the cursor keys to send the <ESC>O prefix, one first has to transmit the DECCKM ('smkx') sequence, which is commented out with the explanation "this will put the auxiliary keypad in dec application mode, which is not appropriate for SCO applications". Normally, the terminal will send <ESC>[A etc, which is not interpreted at all by the curses library as shipped by SCO. Hence the vt100 definition is internally inconsistent. The second is that AIX curses as shipped with the IBM RS/6000 lacks color support, and seems to transmit wildly incorrect sequences using source code which works OK under SysV. I defined the NLS macro but still have scrambled screens. Is there any magic to writing portable, lowest-common-denominator curses code? Should I scrap the keyboard input code and write my own escape- sequence parser, which would be less work than writing a whole display output driver? My co-worker Steve says he has a very good idea why they called it "curses" to begin with. :-) -rich