summaryrefslogtreecommitdiff
path: root/src/draw.c
blob: 75d4dbe57642c782a84f2d005ef74e56022cdbfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <curses.h>
#include <signal.h>

#include "draw.h"

void tui_init() {
	int input; // capture user input
	
	// set an interrupt to end cleanly
	signal(SIGINT, tui_end);

	// init and set options
	initscr();
	keypad(stdscr, TRUE); // enable arrow keys and other function keys
	cbreak();             // set for interactive curses applications

	input = getch();
	tui_end();
}

void tui_end() {
	endwin();
}