当您选择某些内容时,选择的颜色通常会更改为字体颜色,并且字体颜色被设置为背景颜色。因此,如果您在终端中有黑色背景,并且字体为橙色,您将获得橙色选择和黑色字体颜色。
如果你有一个透明的窗口,并且透明度设置为 100%,会发生什么?看看下面的图片。
黑色背景的那个:
还有透明的:

有没有办法改变透明窗口的字体/背景颜色?
我找到了解决方案。有两个可以使用的参数(添加到~/.Xresources文件中):
URxvt*highlightColor: #000000
URxvt*highlightTextColor: #D75F00
Run Code Online (Sandbox Code Playgroud)
解释如下:
Run Code Online (Sandbox Code Playgroud)highlightColor: colour If set, use the specified colour as the background for highlighted characters. If unset, use reverse video. highlightTextColor: colour If set and highlightColor is set, use the specified colour as the foreground for highlighted characters.
现在完全透明窗口上选定的文本如下所示:
