Skip to content

Commit

Permalink
Merge pull request #231 from zevweiss/hide-cursor
Browse files Browse the repository at this point in the history
Hide cursor during initialization and restore at exit
  • Loading branch information
raboof authored Jun 21, 2022
2 parents 517978b + 79ccaf8 commit 8a468d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <ncurses.h>

std::string *caption;
static int cursOrig;
extern const char version[];
extern ProcList *processes;
extern timeval curtime;
Expand Down Expand Up @@ -278,6 +279,7 @@ int GreatestFirst(const void *ma, const void *mb) {

void init_ui() {
WINDOW *screen = initscr();
cursOrig = curs_set(0);
raw();
noecho();
cbreak();
Expand All @@ -291,6 +293,8 @@ void exit_ui() {
clear();
endwin();
delete caption;
if (cursOrig != ERR)
curs_set(cursOrig);
}

void ui_tick() {
Expand Down

0 comments on commit 8a468d8

Please sign in to comment.