#include<termios.h> // for registering raw keypresses, as in menus
#include<time.h> // timespec struct
#include<unistd.h> // for STDIN_FILENO, used with termios
#include"utils.h"
voidclear_screen(void){
#ifdef _WIN32
system("cls");
// terminal manipulation includes - only for non-windows
#ifndef _WIN32
#include<unistd.h> // for STDIN_FILENO, used with termios
#include<termios.h> // for registering raw keypresses, as in menus
#else
#include<conio.h>
#endif
voidclear_screen(void){
#ifndef _WIN32
system("clear");
#else
system("cls");
#endif
}
@@ -21,23 +27,29 @@ FILE *get_urandom(void) {
returnurandom;
}
structtermiosoriginal_terminal_configuration,raw_terminal_configuration;// not sure, but I might feel better if this were in yaht.c
structtermiosoriginal_terminal_configuration,raw_terminal_configuration;// todo come back to this. not sure, but I might feel better if this were in yaht.c
// set terminal to raw mode for registering keypresses without need to press Enter
voidset_raw_terminal_configuration(void){
#ifndef _WIN32 // this is only applicable for unix environments