change logic for tty resize to avoid warning in tests

ping @crosbymichael