From b521d989a5cb854b5c1e78d54a46106542237c11 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 27 Mar 2022 22:20:06 -0400 Subject: replace ifdefs for CURSES with a shell to "tput clear" for clearing the screen --- menudriver.c | 41 ++++------------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) (limited to 'menudriver.c') diff --git a/menudriver.c b/menudriver.c index 63fed32..7d517ef 100644 --- a/menudriver.c +++ b/menudriver.c @@ -78,13 +78,6 @@ int main(int argc, char *argv[]) fastback = !(*fb == 'N' || *fb == 'n'); } -#ifdef CURSES - setupterm(0, 1, &ok); - if (ok != 1) { - fprintf(stderr, "warning: cannot find terminfo entry\n"); - } -#endif - menudrive(argc == 1 ? "." : argv[1]); } @@ -252,7 +245,9 @@ void menudrive(char *dir) *np = '\0'; } } - } else if (strcmp(next, "???") == 0) { /* ask to see menudriver settings */ + + } else if (strcmp(next, "???") == 0) { + /* ask to see menudriver settings */ settings(); printf("[Hit return to continue]"); while (getchar() != '\n') { @@ -434,36 +429,8 @@ void poplast(void) strcpy(last, ++lastp); } -#ifndef CURSES - /* to clear screen */ void clrscr(void) { - printf("\x1b[2J\x1b[H"); - fflush(stdout); + system("tput clear"); } - -#else -/* alternative method needs curses lib, compile with -DCURSES, or -DUWIN - and -lncurses */ - -#ifdef UWIN -#include -#include -#else -#include -#include -#endif - -void clrscr(void) -{ - if (ok != 1) { - return; - } - - putp(clear_screen); - fflush(stdout); -} - -/* end of clrscr method using curses */ -#endif -- cgit v1.2.1