From f62bb2efb607df7590740c89e573ada540ee7610 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Tue, 4 Apr 2017 20:35:05 +0200 Subject: Hide/restore cursor --- metronome.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metronome.c b/metronome.c index 0c5202a..0fe8ff9 100644 --- a/metronome.c +++ b/metronome.c @@ -89,6 +89,9 @@ static int toggle_nonblocking_input() } free(saved_termios); saved_termios = NULL; + + /* restore cursor */ + fprintf(stderr, "\033[?25h"); } else { struct termios new_termios; @@ -108,6 +111,9 @@ static int toggle_nonblocking_input() if ((ret = tcsetattr(STDIN_FILENO, TCSANOW, &new_termios)) < 0) { printf("Failed setting to changed termios: %s\n", strerror(errno)); } + + /* disable cursor */ + fprintf(stderr, "\033[?25l"); } return ret; -- cgit v1.2.3