Has*_*an_ 3 windows .bash-profile git-bash
我读过与此类似的帖子;看来我的问题有所不同。
我怀疑我遇到这个问题是因为我,.bash_profile因为当我删除它并再次打开终端时,它会快速启动,并且显示:
WARNING: Found ~/.bashrc but no ~/.bash_profile, ~/.bash_login or ~/.profile.
This looks like an incorrect setup.
A ~/.bash_profile that loads ~/.bashrc will be created for you.
Run Code Online (Sandbox Code Playgroud)
生成.bash_profile
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
.bashrc
if [ -t 1 ]; then
exec zsh
fi
Run Code Online (Sandbox Code Playgroud)
我的环境变量中还有一个 HOME 变量。
就我而言,我在 Windows 上使用 MING64 和 Git bash。加载每个窗口整整花了 15 秒。事实证明,%USERPROFILE% 中的 .bashrc 是罪魁祸首。
我的系统上安装了 NVM,这些行导致每个终端窗口加载很长时间。
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Run Code Online (Sandbox Code Playgroud)
我注释掉了最后一行,现在 bash 只需一秒钟即可加载。我很少使用NVM,所以不需要在每次启动时加载它。
| 归档时间: |
|
| 查看次数: |
3927 次 |
| 最近记录: |