This should work as long as TTY provides only valid utf8. If the utf is invalid, assertion fails and the shell dies.