summaryrefslogtreecommitdiff
path: root/lib/libcurses/tty/lib_mvcur.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-02-11 00:09:38 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-02-11 00:09:38 +0000
commit108187ab833d9ad9eb7b31c59913131ca545f039 (patch)
tree1ee69d745de9bd778dc7d95bdcd72c090916068b /lib/libcurses/tty/lib_mvcur.c
parentdeede640d45cf7a8dd047a97f85ff8666e116dc2 (diff)
Update to ncurses-4.2-990206:
suppress sc/rc capabilities from terminal description if they appear in smcup/rmcup. This affects only scrolling optimization, to fix a problem reported by several people with xterm's alternate screen, though the problem is more general.
Diffstat (limited to 'lib/libcurses/tty/lib_mvcur.c')
-rw-r--r--lib/libcurses/tty/lib_mvcur.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/libcurses/tty/lib_mvcur.c b/lib/libcurses/tty/lib_mvcur.c
index 9d15770f150..a096cb6b16d 100644
--- a/lib/libcurses/tty/lib_mvcur.c
+++ b/lib/libcurses/tty/lib_mvcur.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_mvcur.c,v 1.1 1999/01/18 19:10:26 millert Exp $ */
+/* $OpenBSD: lib_mvcur.c,v 1.2 1999/02/11 00:09:37 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -155,7 +155,7 @@
#include <term.h>
#include <ctype.h>
-MODULE_ID("$From: lib_mvcur.c,v 1.55 1998/12/05 02:04:48 tom Exp $")
+MODULE_ID("$From: lib_mvcur.c,v 1.56 1999/02/01 12:04:15 tom Exp $")
#define STRLEN(s) (s != 0) ? strlen(s) : 0
@@ -389,6 +389,20 @@ void _nc_mvcur_init(void)
SP->_cursor_to_ll_length = STRLEN(cursor_to_ll);
/*
+ * If save_cursor is used within enter_ca_mode, we should not use it for
+ * scrolling optimization, since the corresponding restore_cursor is not
+ * nested on the various terminals (vt100, xterm, etc.) which use this
+ * feature.
+ */
+ if (save_cursor != 0
+ && enter_ca_mode != 0
+ && strstr(enter_ca_mode, save_cursor) != 0) {
+ T(("...suppressed sc/rc capability due to conflict with smcup/rmcup"));
+ save_cursor = 0;
+ restore_cursor = 0;
+ }
+
+ /*
* A different, possibly better way to arrange this would be to set
* SP->_endwin = TRUE at window initialization time and let this be
* called by doupdate's return-from-shellout code.