diff options
author | 2016-01-31 09:57:09 +0000 | |
---|---|---|
committer | 2016-01-31 09:57:09 +0000 | |
commit | baec74269fdff596476c49b625a9c15226c3e59b (patch) | |
tree | 5c8a8ffdabb137913875a822178e063a340a7d2f /usr.bin/tmux/grid.c | |
parent | Support negative trim values (#{=-10:pane_title}) to trim from the end, (diff) | |
download | wireguard-openbsd-baec74269fdff596476c49b625a9c15226c3e59b.tar.xz wireguard-openbsd-baec74269fdff596476c49b625a9c15226c3e59b.zip |
Add RGB escape sequences for capture-pane -e.
Diffstat (limited to 'usr.bin/tmux/grid.c')
-rw-r--r-- | usr.bin/tmux/grid.c | 16 |
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; |