Better detection of running on the command line.