Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pegasus.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!pegasus!hansen From: hansen@pegasus.UUCP (Tony L. Hansen) Newsgroups: net.info-terms Subject: Re: need termcap/cm help - tvi955 Message-ID: <2575@pegasus.UUCP> Date: Tue, 10-Sep-85 21:01:19 EDT Article-I.D.: pegasus.2575 Posted: Tue Sep 10 21:01:19 1985 Date-Received: Wed, 11-Sep-85 08:06:42 EDT References: <362@varian.UUCP> Reply-To: hansen@pegasus.UUCP (60545451-Tony L. Hansen;LZ 3B-315;6243) Distribution: net Organization: AT&T Information Systems, Lincroft NJ Lines: 57 Keywords: termcap terminfo Summary: termcap can't do it < We just received some TeleVideo 955 terminals -- this a new model -- cheap < ... < The problem: < cursor motion (cm)! < For columns 1 through 80, the cursor motion is the same as for other < TeleVideo terminals (and many other terminals as well) -- < cm = \E=%+\040%+\040 < ... < BUT .. for columns 81 through 132, the sequence is: < ESC = r ~ c < and the value of c is calculated by subtracting 80 from < the column number and then adding space. Such a sequence cannot be done with termcap as it currently exists. Your best bet is, if you can't switch to terminfo, to run the terminal exclusively in 80 column mode and forget 132 column mode. It is exactly for reasons such as this that the stack architecture used by terminfo was introduced. With termcap, everytime a new addressing scheme came out which didn't match a previous scheme, new code had to be written for libtermlib.a and the world relinked with the new library. With terminfo, the format is encoded entirely within the string and instantiated at runtime. Hence, to program the above sequence in terminfo: cup=\E=%p1%' '%+%c%p2%?%{80}%>%t%p2~%{48}%-%c%e%p2%' '%+%c%;, If you're not familiar with what this means, a breakdown follows. Tony Hansen ihnp4!pegasus!hansen cup=\E=%p1%' '%+%c%p2%?%{80}%>%t%p2~%{48}%-%c%e%p2%' '%+%c%;, ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^^ ^ ^ ^ ^ ^ ^ ^ ^ 1 2 3 4 5 6 7 8 9 a b cd e f g h i j k l 1) output ESC = 2) push the first parameter, the row, onto the stack 3) push a space onto the stack 4) add the row and space 5) output the sum as a character 6) push the second parameter, the column, onto the stack 7) if 8) push 80 onto the stack 9) compare: row > 80? a) then b) push the column back onto the stack c) output '~' d) push 48 onto the stack (80 - 040) e) subtract (col - 80 + 040) f) output the difference as a character g) else h) push the column back onto the stack i) push a space onto the stack j) add the column and the space k) output the sum as a character l) fi