Pan*_*nda 5 macos shell terminal
当我在Mac终端上进行一些操作时,用户的输入和shell的输出具有相同的颜色
当我有很多操作并且想要回顾历史时,这很困难,因为用户输入和 shell 输出的所有行都混合在一起。
我想为用户的输入文本指定不同的颜色。如何在 macOS 终端中执行此操作?
系统版本:macOS High Sierra 10.13.1
软件:终端
sco*_*ope 3
添加~/.bash_profile这一行:
~/.bash_profile
export PS1='\[\e[1;31m\]\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ '
它将设置提示的颜色。您可以在这里阅读更多相关内容。
您还可以更改 中的一些颜色Terminal -> Preferences... -> Profiles -> Text。
Terminal -> Preferences... -> Profiles -> Text
归档时间:
8 年 前
查看次数:
9784 次
最近记录:
2 年,2 月 前