前言

Mac如今全面使用zsh替代bash,配置文件也有一点点不同。
默认情况下zsh不开启彩色输出,提示符也是黑白,希望改成熟悉的ubuntu配色。

修改

类似于修改bash的$PS1
找到~/.zshrc写入以下内容
最后两行是命令alias可按需添加

# color term like 'ls'
export CLICOLOR='Yes'
# custom shell prompt
autoload -U colors && colors
PROMPT="%{$fg[green]%}%n@%m%{$reset_color%} %{$fg[blue]%}%1~%{$reset_color%} %# "

# self defined aliases
alias ll='ls -l'
alias la='ls -a'

效果图

修改macOS自带终端zsh为ubuntu配色

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2022-03-03
  • 2021-06-30
  • 2021-05-08
  • 2021-11-25
猜你喜欢
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
相关资源
相似解决方案