version 1.193, 2021/10/05 12:46:02 |
version 1.194, 2021/11/01 09:34:49 |
|
|
static void input_osc_4(struct input_ctx *, const char *); |
static void input_osc_4(struct input_ctx *, const char *); |
static void input_osc_10(struct input_ctx *, const char *); |
static void input_osc_10(struct input_ctx *, const char *); |
static void input_osc_11(struct input_ctx *, const char *); |
static void input_osc_11(struct input_ctx *, const char *); |
|
static void input_osc_12(struct input_ctx *, const char *); |
static void input_osc_52(struct input_ctx *, const char *); |
static void input_osc_52(struct input_ctx *, const char *); |
static void input_osc_104(struct input_ctx *, const char *); |
static void input_osc_104(struct input_ctx *, const char *); |
static void input_osc_110(struct input_ctx *, const char *); |
static void input_osc_110(struct input_ctx *, const char *); |
static void input_osc_111(struct input_ctx *, const char *); |
static void input_osc_111(struct input_ctx *, const char *); |
|
static void input_osc_112(struct input_ctx *, const char *); |
|
|
/* Transition entry/exit handlers. */ |
/* Transition entry/exit handlers. */ |
static void input_clear(struct input_ctx *); |
static void input_clear(struct input_ctx *); |
|
|
input_osc_11(ictx, p); |
input_osc_11(ictx, p); |
break; |
break; |
case 12: |
case 12: |
if (utf8_isvalid(p) && *p != '?') /* ? is colour request */ |
input_osc_12(ictx, p); |
screen_set_cursor_colour(sctx->s, p); |
|
break; |
break; |
case 52: |
case 52: |
input_osc_52(ictx, p); |
input_osc_52(ictx, p); |
|
|
input_osc_111(ictx, p); |
input_osc_111(ictx, p); |
break; |
break; |
case 112: |
case 112: |
if (*p == '\0') /* no arguments allowed */ |
input_osc_112(ictx, p); |
screen_set_cursor_colour(sctx->s, ""); |
|
break; |
break; |
default: |
default: |
log_debug("%s: unknown '%u'", __func__, option); |
log_debug("%s: unknown '%u'", __func__, option); |
|
|
u_char r, g, b; |
u_char r, g, b; |
const char *end; |
const char *end; |
|
|
if (c == 8 || (~c & COLOUR_FLAG_RGB)) |
if (c != -1) |
|
c = colour_force_rgb(c); |
|
if (c == -1) |
return; |
return; |
colour_split_rgb(c, &r, &g, &b); |
colour_split_rgb(c, &r, &g, &b); |
|
|
|
|
} |
} |
} |
} |
|
|
/* Handle the OSC 110 sequence for resetting background colour. */ |
/* Handle the OSC 110 sequence for resetting foreground colour. */ |
static void |
static void |
input_osc_110(struct input_ctx *ictx, const char *p) |
input_osc_110(struct input_ctx *ictx, const char *p) |
{ |
{ |
|
|
screen_write_fullredraw(&ictx->ctx); |
screen_write_fullredraw(&ictx->ctx); |
} |
} |
} |
} |
|
|
|
/* Handle the OSC 12 sequence for setting and querying cursor colour. */ |
|
static void |
|
input_osc_12(struct input_ctx *ictx, const char *p) |
|
{ |
|
struct window_pane *wp = ictx->wp; |
|
int c; |
|
|
|
if (strcmp(p, "?") == 0) { |
|
if (wp != NULL) { |
|
c = ictx->ctx.s->ccolour; |
|
if (c == -1) |
|
c = ictx->ctx.s->default_ccolour; |
|
input_osc_colour_reply(ictx, 12, c); |
|
} |
|
return; |
|
} |
|
|
|
if ((c = input_osc_parse_colour(p)) == -1) { |
|
log_debug("bad OSC 12: %s", p); |
|
return; |
|
} |
|
screen_set_cursor_colour(ictx->ctx.s, c); |
|
} |
|
|
|
/* Handle the OSC 112 sequence for resetting cursor colour. */ |
|
static void |
|
input_osc_112(struct input_ctx *ictx, const char *p) |
|
{ |
|
if (*p == '\0') /* no arguments allowed */ |
|
screen_set_cursor_colour(ictx->ctx.s, -1); |
|
} |
|
|
|
|
/* Handle the OSC 52 sequence for setting the clipboard. */ |
/* Handle the OSC 52 sequence for setting the clipboard. */ |
static void |
static void |