[CLOUD-34] Fix wrong switch to pty