我最近在我的终端上切换到zsh。应用程序在我的OS X机器上成功。zsh的版本号为4.3.11。
当前回答
如果你没有使用Homebrew,这是我刚刚在MAC OS X Lion(10.7.5)上所做的:
Get the latest version of the ZSH sourcecode Untar the download into its own directory then install: ./configure && make && make test && sudo make install This installs the the zsh binary at /usr/local/bin/zsh. You can now use the shell by loading up a new terminal and executing the binary directly, but you'll want to make it your default shell... To make it your default shell you must first edit /etc/shells and add the new path. Then you can either run chsh -s /usr/local/bin/zsh or go to System Preferences > Users & Groups > right click your user > Advanced Options... > and then change "Login shell". Load up a terminal and check you're now in the correct version with echo $ZSH_VERSION. (I wasn't at first, and it took me a while to figure out I'd configured iTerm to use a specific shell instead of the system default).
其他回答
如果安装了Homebrew,就可以这样做。
# check the zsh info
brew info zsh
# install zsh
brew install --without-etcdir zsh
# add shell path
sudo vim /etc/shells
# add the following line into the very end of the file(/etc/shells)
/usr/local/bin/zsh
# change default shell
chsh -s /usr/local/bin/zsh
据我所知,在Mac OS X上安装zsh有三个选项:
预构建二进制文件。我所知道的唯一一款是OS X自带的;这可能就是你现在正在运行的。 使用包系统(Ports, Homebrew)。 从源代码安装。)上次我做这件事并不太难。/configure, make, make install)。
如果你没有使用Homebrew,这是我刚刚在MAC OS X Lion(10.7.5)上所做的:
Get the latest version of the ZSH sourcecode Untar the download into its own directory then install: ./configure && make && make test && sudo make install This installs the the zsh binary at /usr/local/bin/zsh. You can now use the shell by loading up a new terminal and executing the binary directly, but you'll want to make it your default shell... To make it your default shell you must first edit /etc/shells and add the new path. Then you can either run chsh -s /usr/local/bin/zsh or go to System Preferences > Users & Groups > right click your user > Advanced Options... > and then change "Login shell". Load up a terminal and check you're now in the correct version with echo $ZSH_VERSION. (I wasn't at first, and it took me a while to figure out I'd configured iTerm to use a specific shell instead of the system default).
Omz更新给我以下错误:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
这是git的一个问题,升级到Mac OS Ventura(13.0.1)后。Git命令给了我以上错误。
解决方案:
下载并安装“命令行工具”包来修复“git”
xcode-select --install
这将弹出一个对话框。选择“安装”。 更多详情请访问:https://apple.stackexchange.com/a/254381
Omz更新在这之后为我成功工作
我只是把主shell切换到zsh。它抑制了警告,并不太复杂。
推荐文章
- (Mac) -bash: __git_ps1:命令未找到
- 在Bash中重用上一个命令的输出
- 临时更改bash中的当前工作目录以运行命令
- 在Ubuntu中创建一个目录的符号链接
- 在Python中清除终端
- 使用scp将文件复制到Amazon EC2实例?
- 在安装Homebrew后,我得到' zsh:命令未找到:brew '
- Adb命令未找到
- Git不能在MacOS上工作Catalina:“xcrun: error: invalid active developer path (/Library/ developer /CommandLineTools), missing”
- npm install -g less does not work: EACCES:权限被拒绝
- 如何在OS X上编辑$PATH (.bash_profile) ?
- 如何在终端中执行Ruby脚本?
- R专家用户,你的。R配置文件里有什么?
- 在MAC中总是得到zsh:命令没有找到:
- 如何将zsh更新到最新版本?