Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think!mintaka!ogicse!ucsd!ucsdhub!celit!hutch From: hutch@fps.com (Jim Hutchison) Newsgroups: comp.unix.wizards Subject: Re: vt100 termcap (problem/question) Message-ID: <7013@celit.fps.com> Date: 24 Feb 90 02:13:26 GMT References: <1177@psc90.UUCP> Sender: daemon@fps.com Reply-To: hutch@fps.com (Jim Hutchison) Distribution: na Organization: FPS Computing Lines: 31 In <1177@psc90.UUCP> pyr4@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 */