you can add the following script to your .zshrc
and this will cause the newly opened bash session to automatically go to the path of the currently opened file explorer.
cdf() {
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'`
if [[ $target == *"Desktop"* ]]; then
return
elif [[ $target != "" ]]; then
cd "$target"; pwd
fi
}
cdf