fix high cpu load when waiting for user input in Terminal