[comp.sys.sun] curses bug

pays@mars.emse.fr (Paul-Andre Pays) (02/09/90)

Has anyone be able to use (on SUNOS 4.0.3) the curses (terminfo) library?

It seems, that especially with terminals using the "magic cookie glitch",
the handling of video attributes is wrong.

try to
  /usr/5bin/cc revtest.c -lcurses
the following program

#include <stdio.h>
#include <curses.h>

main()
{
	initscr();
	move(3,5);
	addstr(" normal ");
	attrset(A_STANDOUT);
	printw("reverse");
	attrset(0);
	refresh();
	endwin();
}

and use it on a terminal such a tvi925 or hp9836 (with the
magic_cookie_glitch xmc set to 1).
   (the terminfo terminal description was taken from a HP-UX system
   for which everything runs perfectly)

The "reverse" will never be in reverse video mode, because this silly
package for the standout() will
	1. send the appropriate "smso" string to start reverse video
	   BUT
	2. will also send a "^H " which will then immediatly overwrite
	    the attribute setting.

   (it is possible to obtain the reverse video by setting the magic
   cookie to 0!!!!)

Another strange behaviour is that in order to obtain this "reverse video"
on the same terminal we were obliged to remove from the HP-UX terminfo
description the sgr0 attribute, which was unduly sent after each video
attribute setting thus inhibating at once this setting.

Has someone a work around or any solution while waiting for SUN to improve
this SYSTEMV curses library?