Changed getch function to set termios options once after program is read