Merge branch 'osc-10-query'

This commit is contained in:
Boris Faure 2024-04-20 14:38:27 +02:00
commit 87c0538aaf
Signed by: borisfaure
GPG Key ID: EAA9CD729F522998
2 changed files with 11 additions and 11 deletions

View File

@ -4221,6 +4221,14 @@ _handle_xterm_777_command(Termpty *ty,
*title_end = ';';
}
static void
_write_xterm_color_response(Termpty *ty, uint8_t number, int r, int g, int b)
{
char buf[64];
int l = snprintf(buf, sizeof(buf), "\033]%d;rgb:%.2x%.2x/%.2x%.2x/%.2x%.2x\033\\", number, r, r, g, g, b, b);
termpty_write(ty, buf, l);
}
static void
_handle_xterm_10_command(Termpty *ty, Eina_Unicode *p, int len)
{
@ -4229,8 +4237,6 @@ _handle_xterm_10_command(Termpty *ty, Eina_Unicode *p, int len)
if (*p == '?')
{
int r, g, b;
char bf[32];
int l;
#if !defined(BINARY_TYFUZZ) && !defined(BINARY_TYTEST)
evas_object_textgrid_palette_get(
termio_textgrid_get(ty->obj),
@ -4242,8 +4248,7 @@ _handle_xterm_10_command(Termpty *ty, Eina_Unicode *p, int len)
g = config->colors[0].g;
b = config->colors[0].b;
#endif
l = snprintf(bf, sizeof(bf), "\033]10;#%.2X%.2X%.2X\007", r, g, b);
termpty_write(ty, bf, l);
_write_xterm_color_response(ty, 10, r, g, b);
}
else
{
@ -4278,8 +4283,6 @@ _handle_xterm_set_color_class(Termpty *ty, Eina_Unicode *p, int len,
if (*p == '?')
{
int r = 0, g = 0, b = 0;
char buf[64];
int l;
if (edje_object_color_class_get(obj, color_class, &r, &g, &b, NULL,
NULL, NULL, NULL, NULL,
@ -4287,10 +4290,7 @@ _handle_xterm_set_color_class(Termpty *ty, Eina_Unicode *p, int len,
{
ERR("error getting color class '%s' on obj %p", color_class, obj);
}
l = snprintf(buf, sizeof(buf),
"\033]%d;rgb:%.2x%.2x/%.2x%.2x/%.2x%.2x\033\\",
number, r, r, g, g, b, b);
termpty_write(ty, buf, l);
_write_xterm_color_response(ty, number, r, g, b);
}
else
{

View File

@ -145,7 +145,7 @@ color_link_edc.sh 06155942ad90e408ed11225b1e84b6a4
color_link_css_rgb.sh d465a1d5095e550b73e73266452068d9
color_link_css_hsl.sh 3a3dc638c80d5a2a9d5c804a778c09fb
crash_empty_osc.sh 3675247f0d0c1aa439bb5075237e3fe5
xterm-osc-10.sh 3782074fb92672b55351cc11f253b418
xterm-osc-10.sh e96950ab6c1e2df17dca8b55e34a5540
xterm-osc-11.sh 1039019667ac61b387f1436e7eff2398
xterm-osc-12.sh 9237a291abf73341d4e6a9cf94592c6d
xterm-colors-sharp.sh f034efaac9b49ea97e46e9ec4b139c23