[haiku-commits] Re: haiku: hrev45143 - src/apps/terminal

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 10 Jan 2013 22:45:19 +0100

On 2013-01-10 at 03:31:05 [+0100], Sean Bailey <ziusudra@xxxxxxxxx> wrote:
> I do think case 1 should be bright instead of bold, but it would be best to
> handle that in TermView.cpp rather than here. Consider this:
> "\E[22m\E38;5;14mSomeText\E[5mMoreText\E0m" (those escape codes are: bold
> off, color 14, color 5, default color/style) the MoreText should be color 5
> but with this commit will be color 13.

Well, the ECMA spec has only 8 colors. So "color 13" does not mean anything 
for it and using color 13 as "bright color 5" is ok. When using the xterm 
extensions, you get some unexpected results, but that's non-standard anyway.

> This should either be "fAttr &= ~FORECOLORED(255 - 8);" or left as it was.
> If for example the color was set to 240 and the code for color 7 was given,
> after this the color would be set to 247 rather than the requested 7.

Again, I consider the "bold" trick to work properly only for the first 8 
colors. I don't think it is used on other colors anyway (the escape sequence 
\E[5m is used for actual bold text instead).

> 
> 
> > +++ b/src/apps/terminal/TermView.cpp
> > @@ -79,14 +79,14 @@ static rgb_color kTermColorTable[256] = {
> >         {  6, 152, 154, 0},     // cyan
> >         {245, 245, 245, 0},     // white
> >
> 
> If we're going to use color 15 as light-gray than the above should be
> changed to 255,255,255. Though it would be better to make 7 the light-gray
> and 15 the white like xterms do and change any color scheme that is using
> color 7 to use color 15 and change any FORECOLORED(7) to FORECOLORED(15).

Our colors are not the plain saturated ones used elsewhere, and this is on 
purpose. As for swapping colors, that won't help. Having a black on white 
terminal, with black being color 0 and white being color 15, means we are 
using a non-standard default setup. Swapping them results in our 'black' 
being white and vice versa. That's not matching the standard either.

> These changes are rather dark when using a dark background. I'd like to
> have all of the colors in a settings file rather than hard-coded.

On my screen, they are readable on both light and dark screens. We could go 
for 96,96,96 and 140,140,140 or something like that if you think they are 
too dark. The terminal used to have settings for this but they were disabled 
because too much configurability only adds to confusion. I bet mmu_man will 
add suport to his theme manager and patch the terminal so the colors can be 
changed from there, without exposing them in the UI.

I just wanted to quickly merge those changes from fonzoterm before they get 
lost. There's still room for a lot of improvement.

-- 
Adrien.

Other related posts: