Hi,
it's me again - and again it's about colour's in rxvt.
I've played around with character attributes (colours) and noticed that
the escape-sequences for colours 8 to 15 are missing.
A quick patch solved this. But there is a quirk which needs to be
discussed.
rxvt-2.7.5/src/screen.c line 642-645 reads:
else if (color >= minBrightCOLOR && color <= maxBrightCOLOR) {
if (r->h->rstyle & Intensity)
return;
color -= (minBrightCOLOR - minCOLOR);
That way I can choose a color above minBrightCOLOR only if the character
already has the Bold/Blink attribute set?
In consequence my patch sets the attribute and the non-bright color. That
gets translated to a bright color. E.g.
rxvt_scr_rendition(r, 1, RS_Bold);
rxvt_scr_color(r, minCOLOR + (arg[i] - 90), RS_Bold);
instead of just
rxvt_scr_color(r, minBrightCOLOR + (arg[i] - 90), RS_Bold);
Patch to rxvt-2.7.5/src/command.c and rxvt-2.7.5/doc/rxvtRef.txt (I've
been too lazy to edit the html) are attached.
Reference
---------
xterm-144/ctlseqs.ms line 415-466 reads:
CSI Pm m Character Attributes (SGR)
[...]
If 16-color support is compiled, the following apply.
Assume that xterm's resources are set so that the ISO
color codes are the first 8 of a set of 16. Then the
aixterm colors are the bright versions of the ISO colors:
Ps = 9 0 -> Set foreground color to Black
Ps = 9 1 -> Set foreground color to Red
[...]
Ps = 9 7 -> Set foreground color to White
Ps = 1 0 0 -> Set background color to Black
[...]
Ps = 1 0 7 -> Set background color to White
cu.
:
Christian
--- rxvt-2.7.5-pristine/src/command.c Tue Mar 6 18:54:42 2001
+++ rxvt-2.7.5/src/command.c Tue Mar 6 19:30:34 2001
@@ -2558,6 +2558,32 @@
case 49: /* default bg */
rxvt_scr_color(r, restoreBG, RS_Blink);
break;
+
+#ifndef NO_BRIGHTCOLOR
+ case 90:
+ case 91: /* set bright fg color */
+ case 92:
+ case 93:
+ case 94:
+ case 95:
+ case 96:
+ case 97:
+ rxvt_scr_rendition(r, 1, RS_Bold);
+ rxvt_scr_color(r, minCOLOR + (arg[i] - 90), RS_Bold);
+ break;
+
+ case 100:
+ case 101: /* set bright bg color */
+ case 102:
+ case 103:
+ case 104:
+ case 105:
+ case 106:
+ case 107:
+ rxvt_scr_rendition(r, 1, RS_Blink);
+ rxvt_scr_color(r, minCOLOR + (arg[i] - 100), RS_Blink);
+ break;
+#endif
}
}
/*}}} */
--- rxvt-2.7.5-pristine/doc/rxvtRef.txt Tue Sep 19 09:06:46 2000
+++ rxvt-2.7.5/doc/rxvtRef.txt Tue Mar 6 19:38:27 2001
@@ -277,6 +277,14 @@
Ps = 36 / 46 fg/bg Cyan
Ps = 37 / 47 fg/bg White
Ps = 39 / 49 fg/bg Default
+ Ps = 90 / 100 fg/bg bright Black
+ Ps = 91 / 101 fg/bg bright Red
+ Ps = 92 / 102 fg/bg bright Green
+ Ps = 93 / 103 fg/bg bright Yellow
+ Ps = 94 / 104 fg/bg bright Blue
+ Ps = 95 / 105 fg/bg bright Magenta
+ Ps = 96 / 106 fg/bg bright Cyan
+ Ps = 97 / 107 fg/bg bright White
o ESC [ Ps n
Device Status Report (DSR)