diff --git a/config.h b/config.h index 0b024a2..fb5fb67 100644 --- a/config.h +++ b/config.h @@ -9,9 +9,6 @@ // Set global tab width for the editor here static const int tabwidth = 4; -// Enable use of the "alternate screen" in the terminal -static const int use_alternate_screen = 1; // use as bool (0 or 1) - /* * Values from 1 to 256 representing 256 color/8-bit pallate * see: https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit diff --git a/hermes.c b/hermes.c index c47636a..ca01204 100644 --- a/hermes.c +++ b/hermes.c @@ -116,8 +116,8 @@ char *editorPrompt(char *prompt); // terminal // -------- void die(const char *s) { + write(STDOUT_FILENO, "\033[m", 3); write(STDOUT_FILENO, "\033[2J", 4); - write(STDOUT_FILENO, "\033[H", 3); perror(s); write(STDOUT_FILENO, "\r", 1); exit(1); @@ -126,14 +126,12 @@ void die(const char *s) { void quit() { write(STDOUT_FILENO, "\033[m", 3); write(STDOUT_FILENO, "\033[2J", 4); - write(STDOUT_FILENO, "\033[H", 3); exit(0); } void disableRawMode() { if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &E.orig_termios) == -1) die("tcsetattr"); - if (use_alternate_screen) write(STDOUT_FILENO, "\033[?47h", 6); // disable alt screen } void enableRawMode() { @@ -1533,9 +1531,6 @@ void handleSigWinCh(int unused __attribute__((unused))) { // init // ---- void initEditor() { - if (use_alternate_screen) { - write(STDOUT_FILENO, "\033[?47h", 6); - } E.mode = CommandMode; E.rowoff = 0; E.coloff = 0;