36 tcgetattr(STDIN_FILENO, &old);
39 tmp.c_cc[VTIME] = ms / 100;
40 tcsetattr(STDIN_FILENO, TCSANOW, &tmp);
41 read(STDIN_FILENO, &buf, 1);
42 tcsetattr(STDIN_FILENO, TCSANOW, &old);
56 if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1)
79 ft_printf(
"\033[%d;%dH%s", row, col, str);
94 col = (t->
width - len) / 2;
Extended terminal info (for welcome screen pos)
int center_x
Horizontal center col.
int height
Terminal height.
int center_y
Vertical center row.
Welcome screen structures & prototypes.
void print_centered(t_welcome_term *t, int row, const char *str, int len)
Print string centered on the given row.
void ft_msleep(int ms)
Sleep for approximately ms millisecondes using a little trick.
void print_at_pos(int row, int col, const char *str)
Move the terminal cursor to [row, col] and print str.
void get_welcome_term_size(t_welcome_term *t)
Get the terminal size and calculate centre coordinates.