vt100 termcap (problem/question)

Jim Hutchison hutch at fps.com
Sat Feb 24 13:13:26 AEST 1990


In <1177 at psc90.UUCP> pyr4 at psc90.UUCP writes:
>	I have been working with the termcap commands (tgetstr) etc.
...
>	sprintf(buffer,"%s%s%s%s","This is ",SO,"reverse video",SE);
...
>	The output I get looks like:
...
>	This is 2reverse video2
>                 ^  reversed  ^
>              -----------------
>This is part of the vt100 termcap entry:
>Note the 2's:
>	   v            v
>	so=2\E[7m   :se=2\E[m

The 2's are for padding (2 characters worth).  You can either decode the
padding yourself (which is what tputs will do for you, based on the "number
of lines effected").  Reminds me of my old Ann Arbor 4080 which had to have
12 null pads following a "clear screen" at 2400 baud, in order to behave
nicely.  You can pad with any character appropriate to your terminal,
although I've only every seen Null used as a pad.  Null will certainly
work for most vt100-clones.

Nutshell publishes some nice pocket books on the subject of curses/termcap,
including GNU extensions.  You may want to consider picking up a copy as they
are less confusing that the section 3 and 5 manual pages.  The books are also
somewhat more complete in their explanation of *how* to use things.

--
/*    Jim Hutchison   		{dcdwest,ucbvax}!ucsd!celerity!hutch  */
/*    Disclaimer:  I am not an official spokesman for FPS computing   */



More information about the Comp.unix.wizards mailing list