我最近看到gitWindows 中的控制台是彩色的,例如绿色用于添加,红色用于删除等.如何为我的git控制台着色?
git
要安装它,我使用了命令: $ sudo apt-get install git-core
$ sudo apt-get install git-core
git console colors
如何从shell脚本中检测其标准输出是否被发送到终端或者是否通过管道传输到另一个进程?
举个例子:我想添加转义代码来着色输出,但只有在交互式运行时,而不是在管道输出时,类似于什么ls --color.
ls --color
bash shell pipe
bash ×1
colors ×1
console ×1
git ×1
pipe ×1
shell ×1