[net.bugs.4bsd] VI Botches deletes on non-24line VT100s

dan@rna.UUCP (04/13/84)

Subject:
	VI botches line delete on "VT100's" that don't have 24 lines.
Index:	/usr/src/ucb/ex/ex_vadj.c 4.2BSD

Description:
	On ANSI/VT-100 like terminals which have termcap's CS, RC, SC
defined, VI ignores AL and DL (insert line and delete line) (which in
itself is probably not good) and emulates the AL and DL functions by
changing the scrolling region and scrolling in or out a line.
	The code which emulates DL with CS had LI-1 coded as 23, which
assumes a 24line VT100. 23line VT100's (i.e. VT100's with "status-line")
and other terminals like the CIT-500 which has 64 lines failed to
emulate correctly.

Repeat-By:
	Set termcap entry of a VT100 to something other than 24 lines
(e.g. 23 lines) and enter VI and delete a line.

Fix:
*** ex_vadj.c.org	Thu Apr 12 23:56:47 1984
--- ex_vadj.c	Fri Apr 13 00:42:21 1984
***************
*** 748,750
  		vputp(tgoto(CS, LINES-1, p), 1);
! 		vputp(tgoto(CM, 0, 23), 1);	/* Go to lower left corner */
  		for (i=0; i<cnt; i++)		/* .. and scroll cnt times */

--- 748,751 -----
  		vputp(tgoto(CS, LINES-1, p), 1);
! /* dyt - was hardwired as 23 */
! 		vputp(tgoto(CM, 0, LINES-1), 1);/* Go to lower left corner */
  		for (i=0; i<cnt; i++)		/* .. and scroll cnt times */
	If you don't know the fix, don't include this section or "Fix:".


Note also that code in ex_tty.c ignores AL and DL if CS && SC && RS are
defined. I didn't like that either.

					Cheers,
					Dan Ts'o
					...cmcl2!rna!dan