查了很多文章,看到很多都是说由于终端是ZSH模式导致的
只是切换终端的话并没有让我的设置生效
但是切换终端的模式的命令还是贴出来
chsh -s /bin/bash
chsh -s /bin/zsh
最终成功解决是看了这篇文章链接: https://support.apple.com/zh-cn/HT208050
修改了.zprofile文件中的配置,我的环境变量文件是.bash_profile文件所以修改的配置是
[[ -e ~/.bash_profile ]] && emulate sh -c 'source ~/.bash_profile'
export