简体   繁体   English

Mac终端的Bashrc颜色

[英]Bashrc colours for mac terminal

I am trying to create files for dev and prod connections so the colour format is green text black background and red text black background respectively 我正在尝试为开发和产品连接创建文件,因此颜色格式分别为绿色文本黑色背景和红色文本黑色背景

I have created a profile which looks as follows for dev having followed this guide How to change text color & background in mac terminal? 我创建了一个配置文件,对于遵循该指南的开发人员,其外观如下所示。 如何在Mac终端中更改文本颜色和背景?

PS1='[\d \t \u@\h:\w ] $ \e[31m\e[40m'

It successfully creates the text in a red colour and the background colour is black. 它成功创建了红色文本,背景颜色为黑色。 The issue is that some commands default back to a white background while some maintain a black one. 问题是某些命令默认返回白色背景,而另一些则保持黑色背景。

在此处输入图片说明

How can i fix this? 我怎样才能解决这个问题?

Thanks 谢谢

通过不滥用可以使格式“下降”到提示末尾的事实,而不是通过更改终端的默认调色板以替换默认的前景色和背景色来做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM