26 if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == 0)
28 term->
width = ws.ws_col;
50 tcgetattr(STDIN_FILENO, &term->
orig);
52 raw.c_lflag &= ~(ECHO | ICANON);
55 tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
65 tcsetattr(STDIN_FILENO, TCSAFLUSH, &term->
orig);
74 ft_printf(
"╔════════════════════════════════════════╗\n");
76 ft_printf(
"║ See you next time ! ║\n");
78 ft_printf(
"╚════════════════════════════════════════╝\n" RESET "\n");
UI mode structures, macros & function prototypes.
Terminal dimensions & saved state.
struct termios orig
Original termios settings.
void set_raw_mode(t_term *term)
Switch the terminal into non canonical and no echo mode.
void restore_term_mode(t_term *term)
Restore the terminal to the saved settings.
void print_goodbye(void)
Print the exit banner to STDOUT.
void get_term_size(t_term *term)
Get the terinal dimensions via ioctl and store them.