Change logic for tty resize to avoid warning in tests Upstream-commit: 36c26a0f0f7ab32f2edc2f25d8b59b0c33af6001 Component: engine