From b26523c26dc7cf0a24a1adb787aa1816deb40693 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 30 May 2019 20:54:03 +0000 Subject: Remove a leftover abort and some fixes from cppcheck. --- input.c | 1 - 1 file changed, 1 deletion(-) (limited to 'input.c') diff --git a/input.c b/input.c index 4095c05d..e54b5ac0 100644 --- a/input.c +++ b/input.c @@ -2409,7 +2409,6 @@ input_osc_52(struct input_ctx *ictx, const char *p) outlen = 4 * ((len + 2) / 3) + 1; out = xmalloc(outlen); if ((outlen = b64_ntop(buf, len, out, outlen)) == -1) { - abort(); free(out); return; } -- cgit From 5f92f92908b81b4ec66682adb84b9ffc8d83c2f7 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 20 Jun 2019 11:59:59 +0000 Subject: Add a per-pane option set. Pane options inherit from window options (so there should be no change to existing behaviour) and are set and shown with set-option -p and show-options -p. Change remain-on-exit and window-style/window-active-style to be pane options (some others will be changed later). This makes select-pane -P and -g unnecessary so no longer document them (they still work) and no longer document set-window-option and show-window-options in favour of set-option -w and show-options -w. --- input.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index e54b5ac0..3e85e14f 100644 --- a/input.c +++ b/input.c @@ -2347,12 +2347,14 @@ input_osc_10(struct input_ctx *ictx, const char *p) { struct window_pane *wp = ictx->wp; u_int r, g, b; + char tmp[16]; if (sscanf(p, "rgb:%2x/%2x/%2x", &r, &g, &b) != 3) goto bad; - - wp->style.gc.fg = colour_join_rgb(r, g, b); - wp->flags |= PANE_REDRAW; + xsnprintf(tmp, sizeof tmp, "fg=#%02x%02x%02x", r, g, b); + options_set_style(wp->options, "window-style", 1, tmp); + options_set_style(wp->options, "window-active-style", 1, tmp); + wp->flags |= (PANE_REDRAW|PANE_STYLECHANGED); return; @@ -2366,12 +2368,14 @@ input_osc_11(struct input_ctx *ictx, const char *p) { struct window_pane *wp = ictx->wp; u_int r, g, b; + char tmp[16]; if (sscanf(p, "rgb:%2x/%2x/%2x", &r, &g, &b) != 3) goto bad; - - wp->style.gc.bg = colour_join_rgb(r, g, b); - wp->flags |= PANE_REDRAW; + xsnprintf(tmp, sizeof tmp, "bg=#%02x%02x%02x", r, g, b); + options_set_style(wp->options, "window-style", 1, tmp); + options_set_style(wp->options, "window-active-style", 1, tmp); + wp->flags |= (PANE_REDRAW|PANE_STYLECHANGED); return; -- cgit From fc1df91e034627f674ed905be6a1159da883545e Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 20 Jun 2019 13:40:22 +0000 Subject: allow-rename and alternate-screen can be pane options. --- input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'input.c') diff --git a/input.c b/input.c index 3e85e14f..7df2a7b0 100644 --- a/input.c +++ b/input.c @@ -2259,7 +2259,7 @@ input_exit_rename(struct input_ctx *ictx) { if (ictx->flags & INPUT_DISCARD) return; - if (!options_get_number(ictx->wp->window->options, "allow-rename")) + if (!options_get_number(ictx->wp->options, "allow-rename")) return; log_debug("%s: \"%s\"", __func__, ictx->input_buf); -- cgit From dae2868d1227b95fd076fb4a5efa6256c7245943 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 27 Jun 2019 15:17:41 +0000 Subject: Add support for underscore colours with Setulc capability, mostly from Kai Moschcau. --- input.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 7df2a7b0..ff8d7a17 100644 --- a/input.c +++ b/input.c @@ -1829,6 +1829,8 @@ input_csi_dispatch_sgr_256_do(struct input_ctx *ictx, int fgbg, int c) gc->fg = c | COLOUR_FLAG_256; else if (fgbg == 48) gc->bg = c | COLOUR_FLAG_256; + else if (fgbg == 58) + gc->us = c | COLOUR_FLAG_256; } return (1); } @@ -1862,6 +1864,8 @@ input_csi_dispatch_sgr_rgb_do(struct input_ctx *ictx, int fgbg, int r, int g, gc->fg = colour_join_rgb(r, g, b); else if (fgbg == 48) gc->bg = colour_join_rgb(r, g, b); + else if (fgbg == 58) + gc->us = colour_join_rgb(r, g, b); return (1); } @@ -1938,7 +1942,7 @@ input_csi_dispatch_sgr_colon(struct input_ctx *ictx, u_int i) } return; } - if (n < 2 || (p[0] != 38 && p[0] != 48)) + if (n < 2 || (p[0] != 38 && p[0] != 48 && p[0] != 58)) return; switch (p[1]) { case 2: @@ -1983,7 +1987,7 @@ input_csi_dispatch_sgr(struct input_ctx *ictx) if (n == -1) continue; - if (n == 38 || n == 48) { + if (n == 38 || n == 48 || n == 58) { i++; switch (input_get(ictx, i, 0, -1)) { case 2: @@ -2078,6 +2082,9 @@ input_csi_dispatch_sgr(struct input_ctx *ictx) case 55: gc->attr &= ~GRID_ATTR_OVERLINE; break; + case 59: + gc->us = 0; + break; case 90: case 91: case 92: -- cgit