diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-03-27 22:20:06 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-03-27 22:20:06 -0400 |
commit | b521d989a5cb854b5c1e78d54a46106542237c11 (patch) | |
tree | 9df7ab742e06691a0f94e76cfacede5ce2d9f3cd /menudriver.c | |
parent | a7bf5c70f943fdd9d6c956da5aeb347bd1f54120 (diff) |
replace ifdefs for CURSES with a shell to "tput clear" for clearing the screen
Diffstat (limited to 'menudriver.c')
-rw-r--r-- | menudriver.c | 41 |
1 files changed, 4 insertions, 37 deletions
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 <ncurses/curses.h> -#include <ncurses/term.h> -#else -#include <curses.h> -#include <term.h> -#endif - -void clrscr(void) -{ - if (ok != 1) { - return; - } - - putp(clear_screen); - fflush(stdout); -} - -/* end of clrscr method using curses */ -#endif |