guy@rlgvax.UUCP (Guy Harris) (09/22/83)
It was mentioned in net.news.b that the "cs" string is used inconsistently in 4.1BSD "termcap" and 4.1c "termcap"; in 4.1 the "cs" string for the VT100 has a "%r" in it while in 4.1c it doesn't. The order problem is probably due to the fact that the arguments to "tgoto" are "column, line", but most terminals put the line in the cursor motion string first and the column next, so "tgoto" puts the arguments out in reverse order. Therefore, using "tgoto" on the "cs" string requires you to pass the arguments in the order "last line, first line" which is a bit strange so I guess they put in the "%r" in the 4.1 termcap so you would pass them in the order "first line, last line". However, in ex/vi 3.6 that comes with 4.1BSD the "cs" string isn't used anywhere, while in ex/vi 3.7 that comes with 4.1c it is used but "tgoto" is called with the arguments "last line, first line". Therefore, I'd vote for "last line, first line" being the right arguments to "tgoto" when used with the "cs" string, and leaving the "%r" out. Guy Harris {seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy
mark@cbosgd.UUCP (Mark Horton) (09/26/83)
The vt100 cs string should NOT have a %r in it. The two arguments to tgoto have always been backwards from what you would expect. This is especially noticable when you only pass one parameter (e.g. to one of the parameterized local motion capabilities) since you must call tgoto(UP, 0, nlines) instead of the expected tgoto(UP, nlines). This also makes it impossible to have more than 2 parameters passed through tgoto - the code just alternates between the two parms passed. This was fixed in terminfo by replacing tgoto with tparm, which accepts up to 9 parameters: tparm(parm_up_cursor, nlines) Mark Horton