summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-01-31 09:57:10 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-01-31 09:57:10 +0000
commitc8b8c15e787d01c297ff7ac48b461e958bb5b803 (patch)
tree09364e1d85085b71b40c313210bf1ed9760cb532 /usr.bin
parentca082378a35789ebaf578e5ca179b9ea42c9bd95 (diff)
Add RGB escape sequences for capture-pane -e.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/grid.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c
index 642593b5ae9..7011a47f8b6 100644
--- a/usr.bin/tmux/grid.c
+++ b/usr.bin/tmux/grid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grid.c,v 1.51 2016/01/29 11:13:56 nicm Exp $ */
+/* $OpenBSD: grid.c,v 1.52 2016/01/31 09:57:09 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -452,6 +452,12 @@ grid_string_cells_fg(const struct grid_cell *gc, int *values)
values[n++] = 38;
values[n++] = 5;
values[n++] = gc->fg;
+ } else if (gc->flags & GRID_FLAG_FGRGB) {
+ values[n++] = 38;
+ values[n++] = 2;
+ values[n++] = gc->fg_rgb.r;
+ values[n++] = gc->fg_rgb.g;
+ values[n++] = gc->fg_rgb.b;
} else {
switch (gc->fg) {
case 0:
@@ -493,6 +499,12 @@ grid_string_cells_bg(const struct grid_cell *gc, int *values)
values[n++] = 48;
values[n++] = 5;
values[n++] = gc->bg;
+ } else if (gc->flags & GRID_FLAG_BGRGB) {
+ values[n++] = 48;
+ values[n++] = 2;
+ values[n++] = gc->bg_rgb.r;
+ values[n++] = gc->bg_rgb.g;
+ values[n++] = gc->bg_rgb.b;
} else {
switch (gc->bg) {
case 0:
@@ -532,7 +544,7 @@ void
grid_string_cells_code(const struct grid_cell *lastgc,
const struct grid_cell *gc, char *buf, size_t len, int escape_c0)
{
- int oldc[16], newc[16], s[32];
+ int oldc[64], newc[64], s[128];
size_t noldc, nnewc, n, i;
u_int attr = gc->attr;
u_int lastattr = lastgc->attr;