[Konsole-devel] [Bug 107487] Please add the xterm-256 colour support.

lars.doelle at on-line.de lars.doelle at on-line.de
Tue Jun 6 21:20:05 UTC 2006


> Here is the patch. It adds 256 color support.
> There is a problem with transparency and schemas.
> Konsole before used 4 colors in color table specially for default background and foreground.
> I have no idea how to preserve those 4 entries. For now they are removed. I have renumbered
> colors in schemas: 2 -> 0, 3 -> 1, 12 -> 8, etc. Default background is now color number 7.

Witold,

the colors for default fore- and background are important to preserve.
Removing them creates wrong colours. I for one run "Linux Colors", i.e.
a black default background. 

ESC[40m    set black background
...
ESC[47m    set white background
ESC[49m    set default background color

Hmm, i cannot review you code right now, since bugs.kde.org is down for
maintenance.

And Witold - please excuse me - but who on earth designs such ESC codes
as used in the xterm today? Adding an new escape code is not a mindless fun,
as some xterm author apparently believes. There are a few standards, namely
DEC, ANSI and ECMA on ESC codes, but this sequence is really breaking them all.

ESC[48;5;<Color>m

is wrongly designed in principle. And this is why: The sequence is 

ESC[ <PS> m

where <PS> is a string, i.e. a name. Many such names can be grouped into
one ESC code, e.g.

ESC[ <PS1>; <PS2>; <PS3> m

The CSI-m escape code is associative by definition, i.e. the above is exactly the
same as

ESC[ <PS1> m
ESC[ <PS2> m
ESC[ <PS3> m

So ESC[48;5;<Color>m is anything, but an ANSI or ECMA compatible code
by design. It would break associativity of the escape code, which is a no-no.
Plain and simple.

The code really spells
: 48 - set default background color
:   5 - set blink
: <PS> - for <Color> in most cases an unknown name.

E.g. setting 39 for <Color> would for instance mean "set default foreground" and
not any 6x6x6 color.

One can introduce new names, but one cannot break associativity. No way.
This is polluting the escape space with incompatible codes and nothing else.
The code is already in use and not free. Whoever added the code to the
xterm was clearly not aware about this.

I can understand that you find a 6x6x6 color scheme fine. I do, too. But that
one is a private xterm extension, which is totally wrong designed.

So my opinion is that these code should not be added to the konsole, but
instead the issue should be clarified with the xterm author(s). They have
added an incompatible code, and such should it be coped with, imho.

-lars



More information about the konsole-devel mailing list