用 oh-my-zsh https://github.com/robbyrussell/oh-my-zsh
https://github.com/robbyrussell/oh-my-zsh
简单地说就是设置环境变量 PS1
PS1
echo $PS1
可以自己修改 Shell PS1
oh-my-zsh
#4 楼 @hammer #3 楼 @Kabie 谢谢