🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.terminals
Article #1001

Re: Adding 2 to a %d in TERMCAP

#1001
From: Paul Kramer
Date: Fri, 04 Jan 1991 17:32
31 lines
1850 bytes
In article <27827b34.4ede@petunia.CalPoly.EDU> rrauenza@polyslo.CalPoly.EDU (Who, Me??) writes:
>    I am modifying a VT100 termcap entry to more or less shift the
>screen down one row.  (To allow a status line at the top of the
>   The problem is that the cm is currently set to cm=5\E[%i%d;%dH and
>cs set to cs=\E[%i%d;%dr. Since the row parameter is already increased
>by one by the %i, I can't increase it again with %i (I tried and it
>increased the second parameter (%i%i%d;%dr))
>   So, how can I add one more to a parameter that is already %i'd?

If you use the "%+" operator to increment the parameters, there are
at least three ways that you could define each termcap parameter.

By adding a "%+1" to "cm=5\E[%i%d;%dH" becomes: "cm=5\E[%i%+1;%dH" which
retains the incrementing and adds another '1' to the first parameter.
The other possibilities are: "cm=5\E[%+2;%+1H" which adds the desired
values individually to each parameter, and "cm=\5\E[%+2;%i%dH" which uses
the increment operator on the second parameter instead of the "%+!".

Using the same rules on the "cs=\E[%i%d;%dr" string would result in the
following:

cs=\E[%i%+1;%dr
cs=\E[%+2;%+1r
cs=\E[%+2;%i%dr

Warning: I tested these by converting the termcap entry to a terminfo and
running `tput cup 0 0`, I didn't have a termcap program to run them against.
You will obviously need to verify these thoroughly.

cheers,
paul davis kramer
Technical Details
Message-ID: <14575@pyrnj.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!pyrnj!pdk
References: <27827b34.4ede@petunia.CalPoly.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!pyrnj!pdk
From: pdk@pyrnj.uucp (Paul Kramer)
Newsgroups: comp.terminals
Subject: Re: Adding 2 to a %d in TERMCAP
Message-ID: <14575@pyrnj.uucp>
Date: 4 Jan 91 17:32:50 GMT
References: <27827b34.4ede@petunia.CalPoly.EDU>
Reply-To: pdk@pyrnj.UUCP (Paul Kramer)
Distribution: usa
Organization: Pyramid Technology Corp, Woodbridge, NJ
Lines: 31