Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!crdgw1!ge-dab!peora!tarpit!bilver!bill From: bill@bilver.UUCP (Bill Vermillion) Newsgroups: comp.unix.wizards Subject: Re: vt100 termcap (problem/question) Message-ID: <500@bilver.UUCP> Date: 24 Feb 90 18:09:14 GMT References: <1177@psc90.UUCP-> Reply-To: bill@bilver.UUCP (Bill Vermillion) Distribution: na Organization: W. J. Vermillion, Winter Park, FL Lines: 47 In article <1177@psc90.UUCP-> pyr4@psc90.UUCP (**** The Wizard ****) writes: -> -> I have been working with the termcap commands (tgetstr) etc. -> and have run into a snag. The problem is when using a vt100 terminal -> things get a bit strange. Here is a sample of the code I am using. -> -> -> tgetent(termbuf,term = getenv("TERM")); -> -> SO = tgetstr("so",&capptr); /* start reverse mode */ -> SE = tgetstr("se",&capptr); /* end reverse mode */ -> -> sprintf(buffer,"%s%s%s%s","This is ",SO,"reverse video",SE); -> printf("%s\n",buffer); -> -> 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 -> -> What I would like to know is are they there for some purpose? If ->so what is it. I would also like to how to use tgoto and tputs if possible. ->Thanx in advance. The numbers following the equal sign and before the actual escape sequence are used for padding (delay). I have found that in many distrubutions of termcaps that someone has put a delay string in places that do not accept delay strings. I have found this in some SCO termcaps, along with some graphics character reversals. In the FM neither se nor so are permitted to have padding characters. This caused me some grief before I went though the termcap an attribute at a time. This seems to be done in many places. I just grep'ed the termcap file for any "so=2" occurances and just found 10! Take out the "2"s after the = on the above and your problem should go away. bill -- Bill Vermillion - UUCP: uunet!tarpit!bilver!bill : bill@bilver.UUCP