Used #getc instead of #getch to make sure not to reset the raw mode too often