Tty_raw; // for unsolicited input
static int Ttychanged = 0;
- /* Last established cursor state/shape */
+ /* Last established cursor state/shape, and is re-position needed */
static const char *Cursor_state = "";
+static int Cursor_repos;
/* Program name used in error messages and local 'rc' file name */
static char *Myname;
if (Ttychanged) {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &Tty_original);
if (keypad_local) putp(keypad_local);
+ if (Cursor_repos) putp(tg2(0, Screen_rows));
putp("\n");
+#ifdef OFF_SCROLLBK
if (exit_ca_mode) {
// this next will also replace top's most recent screen with the
// original display contents that were visible at our invocation
putp(exit_ca_mode);
}
+#endif
putp(Cap_curs_norm);
putp(Cap_clr_eol);
#ifndef RMAN_IGNORED
/*
* Catches:
- * SIGTSTP, SIGTTIN and SIGTTOU
- * note:
- * we don't fiddle with with those enter/exit_ca_mode strings
- * because we want to retain most of the last screen contents
- * as a visual reminder this program is suspended, not ended! */
+ * SIGTSTP, SIGTTIN and SIGTTOU */
static void sig_paused (int dont_care_sig) {
// POSIX.1-2004 async-signal-safe: tcsetattr, tcdrain, raise
if (-1 == tcsetattr(STDIN_FILENO, TCSAFLUSH, &Tty_original))
error_exit(fmtmk(N_fmt(FAIL_tty_set_fmt), strerror(errno)));
if (keypad_local) putp(keypad_local);
- putp(tg2(0, Screen_rows));
+ if (Cursor_repos) putp(tg2(0, Screen_rows));
putp(Cap_curs_norm);
#ifndef RMAN_IGNORED
putp(Cap_smam);
int i, key;
FLG_t f;
+ Cursor_repos = 1;
spewFI
signify_that:
putp(Cap_clr_scr);
break;
}
} while (key != 'q' && key != kbd_ESC);
+ Cursor_repos = 0;
#undef unSCRL
#undef swapEM
#undef spewFI
// thanks anyway stdio, but we'll manage buffering at the frame level...
setbuffer(stdout, Stdout_buf, sizeof(Stdout_buf));
#endif
+#ifdef OFF_SCROLLBK
// this has the effect of disabling any troublesome scrollback buffer...
if (enter_ca_mode) putp(enter_ca_mode);
+#endif
// and don't forget to ask iokey to initialize his tinfo_tab
iokey(0);
} // end: whack_terminal
//#define INSP_SAVEBUF /* preserve 'Insp_buf' contents in a file */
//#define INSP_SLIDE_1 /* when scrolling left/right don't move 8 */
//#define OFF_HST_HASH /* use BOTH qsort+bsrch vs. hashing scheme */
+//#define OFF_SCROLLBK /* disable tty emulators scrollback buffer */
//#define OFF_STDIOLBF /* disable our own stdout _IOFBF override */
//#define PRETEND2_5_X /* pretend we're linux 2.5.x (for IO-wait) */
//#define PRETEND8CPUS /* pretend we're smp with 8 ticsers (sic) */