fix detecting shell sourcing source when in Zsh, fix #2306