Obscure Vi bug?

Martin Weitzel martin at mwtech.UUCP
Thu Jul 19 23:12:17 AEST 1990


In article <798 at intelhf.hf.intel.com> fredch at starlite.hf.intel.com () writes:
>Has anyone else experienced this?  I have AT&T/Intel Unix V/386 on my box:
>
>Take a 50 line file (not sure if 50-line specific, but that's where I found it).
>Go to 2 lines below the bottom line using the G command.  For example, under
>TERM=xterm, go to line 25; under TERM=AT386 or TERM=vtpc, go to line 26.
>Then type ^B.  It will beep.  Then, type j.  Suddenly the current line will
>be copied onto line 1, and your file just got modified.

Just tried this with ISC 386/ix 2.0.2 and SCO XENIX V. Same bug here.
I produced it in the following way:

1) Take a file somewhat larger than your screen (50 lines are not
   critical)
2) Make line "LINES+1" to be shown in the last line of your screen.
   Use any command you like to do so, move the cursor to any place
   you like, after you have positioned the screen.
   (Note: LINES defaults to 25 for TERM=AT386; so line 26 schould
   be last on the screen. You may verify this by ":set nu")
3) Type ^B (CTRL-B) ==> terminal beeps; screen *doesn't* change
4) Type ^L (Redraw screen) ==> Screen changes, topmost line is 1 now!
5) Type ^L once more ==> first line of screen changes and shows the
   same as the line your cursor were in when you typed ^B in step 3)

I hope somebody who can fix this bug will read this description.

	***********************************************
	**           ALL OTHERS BE WARNED:           **
	**                                           **
	** USING CTRL-B IN vi MAY RESULT IN CHANGING **
	**   YOUR FILE UNDER CERTAIN CIRCUMSTANCES!  **
	***********************************************

Note: I've crossposted this to several other groups where the
readers might be interested in this warning. Furthermore I'm not
at all sure if this bug is specific to SysV.
-- 
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83



More information about the Comp.unix.i386 mailing list