Only accept input if it's TTY.

/cc @imathis