Bug 233991 - color remap xterm ANSI sequences not supported
Summary: color remap xterm ANSI sequences not supported
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 173555 432718 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-10 22:43 UTC by argonel
Modified: 2021-03-10 19:08 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
C demo to show usage of xterms RGB mode (22.13 KB, application/octet-stream)
2010-04-11 11:13 UTC, rofl0r
Details

Note You need to log in before you can comment on or make changes to this bug.
Description argonel 2010-04-10 22:43:52 UTC
It looks like xterm supports some more non-standard color sequences, see http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

OSC = "\e]" or 1B 5D
ST = "\e\\" or 1B 5C

Sequences like "OSC 4;{...} ST" are not handled.

Some of the xterm OSC sequences are handled, but ST is not. Even if the new color sequences aren't to be supported, the ST should be but instead results in "Undecodable sequence: \001b(hex)\\" on stdout.

I have a file that reportedly demonstrates the use of these codes.
Comment 1 rofl0r 2010-04-11 11:13:48 UTC
Created attachment 42679 [details]
C demo to show usage of xterms RGB mode
Comment 2 rofl0r 2010-04-11 11:38:29 UTC
you have to 

export TERM=xterm-256color 

before usage (tput colors should report 256 color mode then)
Comment 3 rofl0r 2010-12-05 15:00:01 UTC
it seem you guys have fear of the evil data buffer in my C program.
i therefore created a C++ application which can display any image on the xterm console, but not on the "K"onsole.

here it is : https://github.com/rofl0r/conpix

it's pretty simple, basically just a class ConsoleWindow and a launcher, and 2 or 3 mini-helper classes. you can see from a quick glance that the code won't harm you.
Comment 4 rofl0r 2010-12-05 17:32:00 UTC
the problem with Konsole here is that it allows 256 colors to be picked, but only if taken from a linear palette (the one used by the famous perl program http://www.frexx.de/xterm-256-notes/data/256colors2.pl ).
however if you pick other colors by RGB values with init_color, that are not in this linear set, it fails. my guess is that the author only used the above perl script for tests.
Comment 5 Jekyll Wu 2011-08-19 16:05:29 UTC
*** Bug 173555 has been marked as a duplicate of this bug. ***
Comment 6 Jekyll Wu 2011-08-27 14:39:30 UTC
maybe related with bug #231405.
Comment 7 Egmont Koblinger 2017-02-14 16:45:45 UTC
OSC 4, 10 and 11 (and probably a few more in the 12-19 range for cursor and highlight fg/bg, see http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands) would be useful for xtermcontrol(1) to work, e.g. to be able to query the default fg/bg colors. See also bug 336849. Note that these should be implemented along with their 104, 110, 111 etc. counterparts that reset these colors.

In VTE (gnome-terminal and friends) the implementation used to take escape sequences (OSC 4, 10...) and API (user changing the palette in the prefs dialog) equally. This led to confusions and unexpected behavior when e.g. opening and closing the prefs (without changing anything) would overwrite the effect of a previous OSC 4.

So we ended up fixing this (in version 0.36) by introducing two levels. For each slot (256 for the palette of OSC 4, plus a few one-offs like default foreground and background) there's the value set via API (e.g. prefs dialog) which always contains a color, and there's the optional value set via OSC 4 (this can be undefined, and actually the OSC hundred's clear this). If the OSC slot is defined for a particular color entry then that one is used, otherwise we fallback to the API. In other words, escape sequences have precedence.
Comment 8 ninjalj 2021-03-09 16:50:22 UTC
*** Bug 432718 has been marked as a duplicate of this bug. ***