fix terminal timeout when pressing escape