Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int reconfigurerTerminal(struct termios* prev)
- {
- struct termios newConfig;
- if(tcgetattr(fileno(stdin), prev) == -1)
- return -1;
- newConfig.c_iflag = prev->c_iflag;
- newConfig.c_oflag = prev->c_oflag;
- newConfig.c_cflag = prev->c_cflag;
- newConfig.c_lflag = 0;
- newConfig.c_cc[VMIN] = 1;
- newConfig.c_cc[VTIME] = 0;
- if(tcsetattr(fileno(stdin), TCSANOW, &newConfig) == -1)
- return -1;
- return 0;
- }
- int restaurerTerminal(struct termios* prev)
- {
- return tcsetattr(fileno(stdin), TCSANOW, prev);
- }
Add Comment
Please, Sign In to add comment