This is version 2 of this patch.  Version one still had a few bugs in it.

The PC console driver (PCVT) has two bugs. Display problems can result if
reverse video mode is turned on or off twice in a row. This patch also
fixes a problem with scrolling region handling that has been seen by many
users trying to use the BitchX irc client with the screen program.

Apply by doing:
	cd /usr/src
	patch -p0 < 014_pcvt.patch

And then rebuild your kernel.

Index: sys/arch/i386/isa/pcvt/pcvt_out.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/isa/pcvt/pcvt_out.c,v
retrieving revision 1.21
retrieving revision 1.25
diff -u -r1.21 -r1.25
--- sys/arch/i386/isa/pcvt/pcvt_out.c	2000/04/09 20:21:30	1.21
+++ sys/arch/i386/isa/pcvt/pcvt_out.c	2000/07/05 03:10:34	1.25
@@ -1,4 +1,4 @@
-/*	$OpenBSD: pcvt_out.c,v 1.21 2000/04/09 20:21:30 aaron Exp $	*/
+/*	$OpenBSD: pcvt_out.c,v 1.25 2000/07/05 03:10:34 aaron Exp $	*/
 
 /*
  * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -216,12 +216,10 @@
 			}
 			if(svsp->lnm) {
 				svsp->cur_offset -= svsp->col;
-				svsp->cur_offset += svsp->maxcol;
 				svsp->col = 0;
 			}
-			else {
-				svsp->cur_offset += svsp->maxcol;
-			}
+			svsp->row = svsp->cur_offset / svsp->maxcol;
+			svsp->cur_offset += svsp->maxcol;
 			check_scroll(svsp);
 			break;
 
@@ -358,6 +356,7 @@
 			if (svsp->lastchar && svsp->m_awm &&
 			    (svsp->lastrow == svsp->row))
 			{
+				svsp->row = svsp->cur_offset / svsp->maxcol;
 				svsp->cur_offset++;
 				svsp->col = 0;
 				svsp->lastchar = 0;
@@ -1304,7 +1303,7 @@
 	{
 		/* we write within scroll region */
 
-		if(svsp->cur_offset >= ((svsp->scrr_end + 1) * svsp->maxcol))
+		if(svsp->row == svsp->scrr_end)
 		{
 			/* the following piece of code has to be protected */
 			/* from trying to switch to another virtual screen */
Index: sys/arch/i386/isa/pcvt/pcvt_vtf.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/isa/pcvt/pcvt_vtf.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- sys/arch/i386/isa/pcvt/pcvt_vtf.c	2000/04/12 13:20:41	1.15
+++ sys/arch/i386/isa/pcvt/pcvt_vtf.c	2000/05/31 23:31:42	1.16
@@ -1,4 +1,4 @@
-/*	$OpenBSD: pcvt_vtf.c,v 1.15 2000/04/12 13:20:41 aaron Exp $	*/
+/*	$OpenBSD: pcvt_vtf.c,v 1.16 2000/05/31 23:31:42 aaron Exp $	*/
 
 /*
  * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -182,8 +182,7 @@
 			break;
 
 		case 7:		/* reverse */
-			svsp->vtsgr |= VT_INVERSE;
-			if (pcdisp) {
+			if (pcdisp && !(svsp->vtsgr & VT_INVERSE)) {
 				if ((setcolor >> 8) == 0)
 					setcolor = (FG_LIGHTGREY << 8);
 				setcolor = (((setcolor >> 8) & 0x88) |
@@ -191,6 +190,7 @@
 				    ((setcolor >> 8) << 4)) & 0x77)) << 8;
 				colortouched = 1;
 			}
+			svsp->vtsgr |= VT_INVERSE;
 			break;
 
 		case 22:	/* not bold */
@@ -218,13 +218,13 @@
 			break;
 
 		case 27:	/* not reverse */
-			svsp->vtsgr &= ~VT_INVERSE;
-			if (pcdisp) {
+			if (pcdisp && (svsp->vtsgr & VT_INVERSE)) {
 				setcolor = (((setcolor >> 8) & 0x88) |
 				    ((((setcolor >> 8) >> 4) |
 				    ((setcolor >> 8) << 4)) & 0x77)) << 8;
 				colortouched = 1;
 			}
+			svsp->vtsgr &= ~VT_INVERSE;
 			break;
 
 		case 30:	/* foreground colors */

