Use different method of zsh detection for better compatibility