From 3cefe78b40b6210dd1991989b800344813c9bd85 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 13 Mar 2022 09:05:55 +0100 Subject: osc: use four digits in OSC-4 and OSC-11 rgb:r/g/b replies Closes #971 --- osc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'osc.c') diff --git a/osc.c b/osc.c index 94b6892c..5d04910b 100644 --- a/osc.c +++ b/osc.c @@ -596,8 +596,9 @@ osc_dispatch(struct terminal *term) char reply[32]; size_t n = xsnprintf( - reply, sizeof(reply), "\033]4;%u;rgb:%02x/%02x/%02x%s", - idx, r, g, b, terminator); + reply, sizeof(reply), + "\033]4;%u;rgb:%02hhx%02hhx/%02hhx%02hhx/%02hhx%02hhx%s", + idx, r, r, g, g, b, b, terminator); term_to_slave(term, reply, n); } @@ -695,8 +696,9 @@ osc_dispatch(struct terminal *term) */ char reply[32]; size_t n = xsnprintf( - reply, sizeof(reply), "\033]%u;rgb:%02x/%02x/%02x%s", - param, r, g, b, terminator); + reply, sizeof(reply), + "\033]%u;rgb:%02hhx%02hhx/%02hhx%02hhx/%02hhx%02hhx%s", + param, r, r, g, g, b, b, terminator); term_to_slave(term, reply, n); break; -- cgit v1.3