summaryrefslogtreecommitdiffstats
path: root/games/grdc
diff options
context:
space:
mode:
authorpjanzen <pjanzen@openbsd.org>2000-01-21 07:10:39 +0000
committerpjanzen <pjanzen@openbsd.org>2000-01-21 07:10:39 +0000
commit214232ef1fb3561c13352a87683268028485bbb0 (patch)
treea440dfc63d32b925af8f414dc51999cd1310c7e7 /games/grdc
parentImprove score table formatting (partially from malcolm@bits.bris.ac.uk (diff)
downloadwireguard-openbsd-214232ef1fb3561c13352a87683268028485bbb0.tar.xz
wireguard-openbsd-214232ef1fb3561c13352a87683268028485bbb0.zip
Hide cursor if possible
Diffstat (limited to 'games/grdc')
-rw-r--r--games/grdc/grdc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/games/grdc/grdc.c b/games/grdc/grdc.c
index 0b6f2d28c0e..487e7ea1c71 100644
--- a/games/grdc/grdc.c
+++ b/games/grdc/grdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grdc.c,v 1.6 2000/01/20 12:31:33 d Exp $ */
+/* $OpenBSD: grdc.c,v 1.7 2000/01/21 07:10:39 pjanzen Exp $ */
/*
* Grand digital clock for curses compatible terminals
* Usage: grdc [-s] [n] -- run for n seconds (default infinity)
@@ -58,6 +58,7 @@ main(argc, argv)
int n = 0;
struct timeval nowtv;
struct timespec delay;
+ char *hc;
/* revoke privs */
setegid(getgid());
@@ -82,6 +83,9 @@ main(argc, argv)
attrset(COLOR_PAIR(2));
}
+ if ((hc = tigetstr("civis")) != 0 && hc != (char *)-1)
+ putp(hc);
+
clear();
refresh();
while(--argc > 0) {
@@ -164,6 +168,8 @@ main(argc, argv)
if (sigtermed) {
standend();
+ if ((hc = tigetstr("cnorm")) > 0 && hc != (char *)-1)
+ putp(hc);
clear();
refresh();
endwin();
@@ -172,6 +178,8 @@ main(argc, argv)
}
} while(--n);
standend();
+ if ((hc = tigetstr("cnorm")) > 0 && hc != (char *)-1)
+ putp(hc);
clear();
refresh();
endwin();
@@ -215,4 +223,3 @@ movto(int line, int col)
{
move(line, col);
}
-