diff options
author | etheisen <etheisen@cvs.openbsd.org> | 1996-09-21 06:06:43 +0000 |
---|---|---|
committer | etheisen <etheisen@cvs.openbsd.org> | 1996-09-21 06:06:43 +0000 |
commit | 584e4bbf452da2934dbaf4b9dc09bd131a1d4cd7 (patch) | |
tree | 2c9db12c868140432b9523beaa56096cacc3ec35 /usr.bin/less/screen.c | |
parent | 5b2dc2545f95d91daf78365b3c049b1e3f8aa819 (diff) |
Incorporate less modifications for more and our bug fixes from previous
version.
Diffstat (limited to 'usr.bin/less/screen.c')
-rw-r--r-- | usr.bin/less/screen.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/usr.bin/less/screen.c b/usr.bin/less/screen.c index 95082ac6432..8340dd408a9 100644 --- a/usr.bin/less/screen.c +++ b/usr.bin/less/screen.c @@ -136,6 +136,8 @@ extern int know_dumb; /* Don't complain about a dumb terminal */ extern int back_scroll; extern int swindow; extern int no_init; +extern int quit_at_eof; +extern int more_mode; #if HILITE_SEARCH extern int hilite_search; #endif @@ -412,9 +414,10 @@ cannot(s) { PARG parg; - if (know_dumb) + if (know_dumb || more_mode) /* * User knows this is a dumb terminal, so don't tell him. + * more doesn't complain about these, either. */ return; @@ -755,11 +758,17 @@ get_term() if (sc_e_keypad == NULL) sc_e_keypad = ""; - sc_init = tgetstr("ti", &sp); + /* + * This loses for terminals with termcap entries with ti/te strings + * that switch to/from an alternate screen, and we're in quit_at_eof + * (eg, more(1)). + */ + if (!quit_at_eof && !more_mode) { + sc_init = tgetstr("ti", &sp); + sc_deinit = tgetstr("te", &sp); + } if (sc_init == NULL) sc_init = ""; - - sc_deinit= tgetstr("te", &sp); if (sc_deinit == NULL) sc_deinit = ""; @@ -982,7 +991,9 @@ init() if (no_init) return; tputs(sc_init, sc_height, putchr); +#if 0 tputs(sc_s_keypad, sc_height, putchr); +#endif init_done = 1; } @@ -996,7 +1007,9 @@ deinit() return; if (!init_done) return; +#if 0 tputs(sc_e_keypad, sc_height, putchr); +#endif tputs(sc_deinit, sc_height, putchr); init_done = 0; } |