summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>1999-11-16 21:57:50 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>1999-11-16 21:57:50 +0000
commitd1428aa9bae017c0199556f6b98ee610a0de43a0 (patch)
treefc207de48e6ff3e858bf00425106e1619dd96107 /sys
parent8f049ae088053b04ad5e6233ff6757346e68c83e (diff)
- Teach vt_cuu (cursor up) about scrollback. Cursor down is much harder...
- Support ANSI save/restore cursor position escape sequences. - Move the line-wrap check out of the STATE_INIT case so it is executed regardless of the state. This fixes a subtle bug.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_out.c50
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_vtf.c5
2 files changed, 34 insertions, 21 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_out.c b/sys/arch/i386/isa/pcvt/pcvt_out.c
index 6143ec8444e..3e72ce3e291 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_out.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_out.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_out.c,v 1.14 1999/10/20 19:15:51 deraadt Exp $ */
+/* $OpenBSD: pcvt_out.c,v 1.15 1999/11/16 21:57:49 aaron Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -431,28 +431,28 @@ sput (u_char *s, U_char kernel, int len, int page)
/* char range 0x20...0xff processing depends on current state */
+ if(svsp->lastchar && svsp->m_awm &&
+ (svsp->lastrow == svsp->row))
+ {
+ svsp->cur_offset++;
+ svsp->col = 0;
+ svsp->lastchar = 0;
+ if (check_scrollback(svsp))
+ {
+ bcopy(svsp->Crtat +
+ svsp->cur_offset -
+ svsp->maxcol,
+ svsp->Scrollback +
+ (svsp->scr_offset *
+ svsp->maxcol),
+ svsp->maxcol * CHR);
+ }
+ check_scroll(svsp);
+ }
+
switch(svsp->state)
{
case STATE_INIT:
- if(svsp->lastchar && svsp->m_awm &&
- (svsp->lastrow == svsp->row))
- {
- svsp->cur_offset++;
- svsp->col = 0;
- svsp->lastchar = 0;
- if (check_scrollback(svsp))
- {
- bcopy(svsp->Crtat +
- svsp->cur_offset -
- svsp->maxcol,
- svsp->Scrollback +
- (svsp->scr_offset *
- svsp->maxcol),
- svsp->maxcol * CHR);
- }
- check_scroll(svsp);
- }
-
if(svsp->irm)
bcopy ((svsp->Crtat
+ svsp->cur_offset),
@@ -924,6 +924,16 @@ sput (u_char *s, U_char kernel, int len, int page)
svsp->state = STATE_INIT;
break;
+ case 's': /* save cursor position */
+ vt_sc(svsp);
+ svsp->state = STATE_INIT;
+ break;
+
+ case 'u': /* restore cursor position */
+ vt_rc(svsp);
+ svsp->state = STATE_INIT;
+ break;
+
case 'x': /*request/report parameters*/
vt_reqtparm(svsp);
svsp->state = STATE_INIT;
diff --git a/sys/arch/i386/isa/pcvt/pcvt_vtf.c b/sys/arch/i386/isa/pcvt/pcvt_vtf.c
index 690b7b7eb3b..48cce2a1de1 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_vtf.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_vtf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcvt_vtf.c,v 1.8 1999/10/20 19:15:52 deraadt Exp $ */
+/* $OpenBSD: pcvt_vtf.c,v 1.9 1999/11/16 21:57:49 aaron Exp $ */
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -286,6 +286,9 @@ vt_cuu(struct video_state *svsp)
return;
svsp->cur_offset -= (svsp->maxcol * p);
+
+ if (svsp->scr_offset >= p)
+ svsp->scr_offset -= p;
}
/*---------------------------------------------------------------------------*