-1

昨天我已经将我的 MacOS 从 catalina 更新到 big sur。每当我打开终端时,我都会遇到错误。

Last login: Sat Nov 14 17:54:05 on ttys000
/Users/amolbhure/.zshrc:6: no such file or directory: source~/.bash_profile
/Users/amolbhure/.zshrc:104: compinit: function definition file not found
/Users/amolbhure/.oh-my-zsh/oh-my-zsh.sh:78: compinit: function definition file not found
/Users/amolbhure/.oh-my-zsh/lib/completion.zsh:75: bashcompinit: function definition file not found
No version set for command direnv
Consider adding one of the following versions in your config file at /Users/amolbhure/.tool-versions
direnv 2.23.1
/Users/amolbhure/.zshrc:113: compinit: function definition file not found
/Users/amolbhure/.zshrc:117: compinit: function definition file not found
/Users/amolbhure/.zshrc:121: compinit: function definition file not found
No version set for command direnv
Consider adding one of the following versions in your config file at /Users/amolbhure/.tool-versions
direnv 2.23.1
/Users/amolbhure/.zshrc:126: compinit: function definition file not found
/Users/amolbhure/.zshrc:130: compinit: function definition file not found
/Users/amolbhure/.zshrc:134: compinit: function definition file not found
/Users/amolbhure/.zshrc:138: compinit: function definition file not found
/Users/amolbhure/.zshrc:142: compinit: function definition file not found
/Users/amolbhure/.zshrc:146: compinit: function definition file not found
/Users/amolbhure/.zshrc:150: compinit: function definition file not found
/Users/amolbhure/.zshrc:154: compinit: function definition file not found
/Users/amolbhure/.zshrc:158: compinit: function definition file not found
/Users/amolbhure/.zshrc:162: compinit: function definition file not found
/Users/amolbhure/.zshrc:166: compinit: function definition file not found
/Users/amolbhure/.zshrc:170: compinit: function definition file not found
/Users/amolbhure/.zshrc:174: compinit: function definition file not found
/Users/amolbhure/.zshrc:178: compinit: function definition file not found
/Users/amolbhure/.zshrc:182: compinit: function definition file not found
/Users/amolbhure/.zshrc:186: compinit: function definition file not found
/Users/amolbhure/.zshrc:190: compinit: function definition file not found
/Users/amolbhure/.zshrc:194: compinit: function definition file not found
/Users/amolbhure/.zshrc:198: compinit: function definition file not found
/Users/amolbhure/.zshrc:202: compinit: function definition file not found
/Users/amolbhure/.zshrc:206: compinit: function definition file not found
/Users/amolbhure/.zshrc:210: compinit: function definition file not found
/Users/amolbhure/.zshrc:214: compinit: function definition file not found
/Users/amolbhure/.zshrc:218: compinit: function definition file not found
/Users/amolbhure/.zshrc:222: compinit: function definition file not found
/Users/amolbhure/.zshrc:226: compinit: function definition file not found
/Users/amolbhure/.zshrc:230: compinit: function definition file not found
/Users/amolbhure/.zshrc:234: compinit: function definition file not found
/Users/amolbhure/.zshrc:238: compinit: function definition file not found
➜  ~ 

我无法输入任何内容。如果我从计算机键入任何关键字,它就会将我抛出错误,并且它会一直这样。真令人沮丧。

-zsh:1: url-quote-magic: function definition file not found
4

1 回答 1

1

我不完全知道这个问题的根本原因,但我通过卸载并重新安装 oh-my-zsh 解决了这个问题。

最棘手的部分是让任何 shell 工作。我最终需要/bin/bash在我的终端中加载。首选项 > 常规 > “Shell 打开方式:” > 命令/bin/bash

一旦我可以运行 bash,我就删除了 oh-my-zsh

rm -rf ~/.oh-my-zsh

之后我可以立即重新安装它:

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

备份你的.zshrc第一个以防万一!

于 2020-11-14T17:54:58.790 回答