if (-t STDIN) { # STDIN is connected to the console }