Automatic shell detection