client: function to check if stdin is a tty