repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: d33a3cecd1c2689c6b66a3f4d3071a67c40f826f:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit d33a3cecd1c2689c6b66a3f4d3071a67c40f826f
Author: Emanuele Giaquinta 
Date:   Sun May 9 15:47:51 2021 +0000

    Add missing color index parameter to OSC 4 response

    Patch by Přemysl Eric Janouch.

diff --git a/src/command.C b/src/command.C
index 7ef2b757490a924323ea7654f977fdab5b5207d5..
index ..b00b61495be0fa0c782d5327b2dbb601714e76f5 100644
--- a/src/command.C
+++ b/src/command.C
@@ -3397,15 +3397,19 @@ rxvt_term::process_color_seq (int report, int color, const char *str, char resp)
 {
   if (str[0] == '?' && !str[1])
     {
+      if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR))
+        return;
+
       rgba c;
       pix_colors_focused[color].get (c);
+      color -= minCOLOR;

 #if XFT
       if (c.a != rgba::MAX_CC)
-        tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.r, c.g, c.b, c.a, resp);
+        tt_printf ("\033]%d;%d;rgba:%04x/%04x/%04x/%04x%c", report, color, c.r, c.g, c.b, c.a, resp);
       else
 #endif
-        tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp);
+        tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", report, color, c.r, c.g, c.b, resp);
     }
   else
     set_window_color (color, str);

-----END OF PAGE-----