diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-06-27 15:17:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-06-27 15:17:42 +0000 |
commit | 177496c71ff81f14d51f1a5f0f3df1f1c09a24c5 (patch) | |
tree | 742aa31970ba0a0d0fecc596623d3d2569b608d0 /usr.bin/tmux/input.c | |
parent | bdc1ed3a36fcefe6cbddbf4592642b2468653540 (diff) |
Add support for underscore colours with Setulc capability, mostly from
Kai Moschcau.
Diffstat (limited to 'usr.bin/tmux/input.c')
-rw-r--r-- | usr.bin/tmux/input.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index cb86dbb7cba..7881dbdb3a2 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.157 2019/06/20 13:40:22 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.158 2019/06/27 15:17:41 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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: |