[comp.unix.i386] Cursing at Magic Cookies

roger@.uucp (Roger Droz) (08/23/90)

The clever subject line shows that I still have some sense of humor left
after trying to get a "magic cookie" terminal to work with curses under
Interactive Unix 386, release 3.2.  

The terminals in question are a Wyse 50 and an Lear Siegler ADM 11.
The terminfos for the ADM 11, and Wyse 50 are as follows:

adm11|lsi adm11,
	xon,
	cols#75, lines#24, xmc#1,
	bel=^G, clear=\E*, cr=\r, cub1=\b, cud1=\n, cuf1=\f,
	cup=\E=%p1%'\s'%+%c%p2%'\s'%+%c, cuu1=^K, ed=\EY,
	el=\ET, home=^^, ind=\n, kcub1=\b, kcud1=\n, kcuf1=\f,
	kcuu1=^K, rmso=\EG0, smso=\EG4,

wy50:vp|Wyse Technology  50 (emulating Adds viewpoint),
	hs, xon,
	cols#80, it#100, lines#24, ma#1, wsl#78, xmc#1,
	bel=^G, blink=\EG2, civis=\E`0, clear=\E;, cnorm=\E`1,
	cr=\r, cub1=^U, cud1=^V, cuf1=^F,
	cup=\EY%p1%'\s'%+%c%p2%'\s'%+%c, cuu1=^Z, cvvis=\E`1,
	dch1=\EW, dl1=\El, dsl=\Ez(\r, ed=\Ek, el=\EK,
	flash=\E`8$<100>\E`9, fsl=\r, home=^A, il1=\EM,
	ind=\n, invis=\EG3, is2=\E6\E`6, kbs=\b, kcbt=\EI,
	kclr=\Ek, kcub1=^U, kcud1=\n, kcuf1=^F, kcuu1=^Z,
	kdch1=\EW, kdl1=\El, ked=\Ek, kel=\EK, kf1=^B1,
	kf2=^B2, kf3=^B3, kf4=^B4, kf5=^B5, kf6=^B6, kf7=^B7,
	kf8=^B8, kf9=^B9, khome=^A, kich1=\EQ, kil1=\EM,
	knp=\EJ, kprt=\EP, krmir=\Er, mc0=\EP, mc4=\E4,
	mc5=\E3, nel=^_, pad=\200, rmacs=\EH^C, rmir=\Er,
	rmso=\EG0, rmul=\EG0, rs2=\E6\E`6\E`:\EG0, sgr0=\EG0,
	smacs=\EH^B, smir=\Eq, smkx=\E6\E`6, smso=\EG4,
	smul=\EG8, tbc=\E3, tsl=\Ez(,

These terminfos work on our Unisys System V just fine.  Under
Interactive, curses emits a cub1 after depositing the "magic cookie" to
activate standout mode.  The next character overstrikes the magic
cookie, which removes the command to go into standout mode.  Thus
standout mode does not function on the Interactive system while it works
fine on the Unisys system. 

Specifying xmc#0 sort of works, but many non-magic cookie terminfos use
xmc#0 to indicate that attributes do not take up space on the screen. 
On both the Wyse 50 and the ADM 11 the "magic cookie" that sets up the
attribute visibly takes up a space.

/usr/local/bin/less correctly compensates for the magic cookie taking
up one space on the screen.  If the terminfo is changed to xmc#0, less
will output an extra space on either side of highlighted words in man
pages.

Looks like less is happiest with xmc#1 and curses is happiest with
xmc#0.  Not nice...

(Readers familiar with termcap substitute smg#1 and smg#0 in the above
discussion.)
____________
               Roger Droz       UUCP: uw-beaver!gtisqr!roger
()       ()    Maverick MICRoSystems / Global Technology International
 (_______)     Mukilteo, WA 
  (     )      
   |   |       Disclaimer: "We're all mavericks here: 
   |   |                    Each of us has our own opinions,
   (___)                    and the company has yet different ones!"