简体   繁体   English

使用Git Bash在Cmder / ConEmu中缺少黑色

[英]Black color missing in Cmder/ConEmu with Git Bash

I'm using the latest preview of the Cmder console emulator and the Git for Windows 2.20.1. 我正在使用Cmder控制台仿真器和Windows 2.20.1的Git的最新预览版。

I followed the Pretty git branch graphs question response where git tree aliases are presented and defined my variant of the alias in ~/.gitconfig : 我遵循了Pretty git branch graphs问题响应,其中显示了git tree别名,并在~/.gitconfig定义了别名的变体:

[alias]
tree = log --all --graph --decorate=short --color --format=format:'%C(bold blue)%h%C(reset) %C(auto)%d%C(reset)\n%x09%x09%x09%C(black)%s %C(reset)'

Basically, this renders commit message in black as it was faded away. 基本上,这将提交消息淡化为黑色。 It works well in the Git Bash console (right-hand side on the screenshot), while in the Cmder (left-hand side), the commit messages in black are not visible (of course, they are there, if I select the output): 它在Git Bash控制台(屏幕截图的右侧)中运行良好,而在Cmder(左侧)中,黑色的提交消息不可见(当然,如果我选择了输出,它们就在那里了) ):

在此处输入图片说明

What tweaks to the colors would be required to make the left-hand side console look similar to the right-hand side? 要使左侧控制台看起来与右侧相似,需要对颜色进行哪些调整?

That is, to make the commit messages in black visible. 也就是说,使黑色的提交消息可见。

To be honest, I don't know if this is issue with Cmder or ConEmu configuration. 老实说,我不知道这与Cmder或ConEmu配置有关。 I have tried all the color themes coming with Cmder, but without any improvement. 我尝试了Cmder随附的所有颜色主题,但没有任何改进。

That is because when you run the command in posix terminal, black is treated as rgb(0,0,0). 这是因为在posix终端中运行命令时, black被视为rgb(0,0,0)。 But when you run git in WinAPI terminal, the output result is "color with index 0 ". 但是,当您在WinAPI终端中运行git时,输出结果是“ 索引为0的颜色”。

You may try posix mode in ConEmu too, but it's not so easy to setup for new users. 您也可以在ConEmu中尝试posix模式 ,但是对于新用户而言,设置起来并不容易。

The simplest way: 最简单的方法:

  1. change color of index 0 to 0 0 0 索引0的颜色更改为0 0 0

在此处输入图片说明

  1. and change background color to appropriate value. 并将背景色更改为适当的值。

在此处输入图片说明

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

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