Commits

Martin Kühl committed 060259a

Reset default termios state when exiting.

Comments (0)

Files changed (1)

 
 int main(int argc, char **argv)
 {
-	struct termios set;
+	struct termios set, defset;
 	int i;
 
 	for (i = 1; i < argc; i++) {
 		usage();
 
 	tcgetattr(0, &set);
+	defset = set;
 	set.c_lflag &= ~ECHO;
 
 	if (signal(SIGCHLD, sigchld) == SIG_ERR)
 	print_usr();
 	run();
 
+	tcsetattr(0, TCSANOW, &defset);
 	return 0;
 }