tty awareness. fixes #12