Check for terminal on both stdout and stderr