Fix exit code issue with TTY mode Upstream-commit: 0e356d49aa3e286645a4ff36430283ca66d7084d Component: engine