mirror of
1
0
Fork 0

Updated tty.c

This commit is contained in:
Tristan B. Kildaire 2020-05-05 21:49:31 +02:00
parent 7bafa9cf52
commit 38c6705564
1 changed files with 22 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include<termios.h>
#include<sys/ioctl.h>
struct termios oldSettings;
@ -23,10 +24,31 @@ void startTTY()
/* Set the tty to raw mode */
tcsetattr(0, 0, &termy);
testicle();
}
void testicle()
{
/* window size struct */
struct winsize size;
/* IOCTL the vnode via the fd that points to it */
ioctl(0, TIOCGWINSZ, &size);
printf("row: %u\n", size.ws_row);
printf("col: %u\n", size.ws_col);
}
void stopTTY()
{
/* Restore the tty settings back to the original */
tcsetattr(0, 0, &oldSettings);
}
void setCursor(int x, int y, struct TTY* tty)
{
}