zsh的MacOs终端问题



昨天我把我的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

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

最棘手的部分是让任何外壳工作。我最终需要在我的终端中加载/bin/bash。首选项>概述>quot;外壳打开时带有:">命令/bin/bash

一旦我可以运行bash,我就删除了我的zsh

rm -rf ~/.oh-my-zsh

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

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

先备份你的.zshrc以防万一!

最新更新