Respond to OSC 4 query.
authornicm <nicm@openbsd.org>
Tue, 7 Dec 2021 07:28:44 +0000 (07:28 +0000)
committernicm <nicm@openbsd.org>
Tue, 7 Dec 2021 07:28:44 +0000 (07:28 +0000)
usr.bin/tmux/input.c

index cb7fede..e01f29a 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.197 2021/12/07 07:21:40 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.198 2021/12/07 07:28:44 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2530,6 +2530,12 @@ input_osc_4(struct input_ctx *ictx, const char *p)
                }
 
                s = strsep(&next, ";");
+               if (strcmp(s, "?") == 0) {
+                       c = colour_palette_get(ictx->palette, idx);
+                       if (c != -1)
+                               input_osc_colour_reply(ictx, 4, c);
+                       continue;
+               }
                if ((c = input_osc_parse_colour(s)) == -1) {
                        s = next;
                        continue;