terminfo

David E A Wilson david at uowcsa.cs.uow.oz
Sat Aug 27 15:05:46 AEST 1988


In article <13202 at mimsy.UUCP>, chris at mimsy.UUCP (Chris Torek) writes:
> I hear someone asking: `what is wrong with termcap, anyway?'  All
> right, quick, tell me how you convert a cursor position to a base 8
> one's complement row number offset by ' ' followed by a base 8 one's
> complement column number offset by ' ' and occupying two characters
> if and only if the value produced is by the first character is >= 95
> (in which case the first character is stopped at 95 and the second
> is summed into the first, after bit-flipping and converting back from
> octal)?

How about this then? We have a set of VT220 compatible terminals which
have added funtions such as labels at the bottom of the screen.
The way to program both these labels & the function keys is to send the
following (for an output/display of HELLO) (first key & label):

	Key:	ESC P 1 ; 1 | 1 7 / 4 8 4 5 4 C 4 C 4 F ESC \

	Label:	ESC P 0 ; 1 r 0 / 4 8 4 5 4 C 4 C 4 F ESC \

How can I encode this so that the application does not need to encode
the string in hex? Here are the terminfo definitions I use that do require
this.
	pfx=%p1%Pa%?%p1%{5}%>%t%?%p1%{10}%>%t%?%p1%{14}%>%t%?%p1%{16}
		%>%t%ga%{14}%+%e%ga%{13}%+%;%e%ga%{12}%+%;%e%ga%{11}
		%+%;\EP1;1|%d/%p2%s\E\\%;,
	pln=\EP0;1r%p1%{1}%-%d/%p2%s\E\\,

The gastly pfx string is because DEC in its wisdom saw fit to allocate
numbers to the holes in between the function key groups. Clues anyone?

David E.A. Wilson		ACSnet:	david at uowcsa.oz
Dept. of Computing Science	UUCP:	...!munnari!uowcsa.oz!david
Uni. of Wollongong		ARPA:	david%uowcsa.oz at uunet.UU.NET



More information about the Comp.unix.wizards mailing list