=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/format.c,v retrieving revision 1.273 retrieving revision 1.274 diff -u -r1.273 -r1.274 --- src/usr.bin/tmux/format.c 2021/02/09 14:25:40 1.273 +++ src/usr.bin/tmux/format.c 2021/02/15 09:39:37 1.274 @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.273 2021/02/09 14:25:40 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.274 2021/02/15 09:39:37 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -878,6 +878,28 @@ return (value); } +/* Callback for pane_fg. */ +static char * +format_cb_pane_fg(struct format_tree *ft) +{ + struct window_pane *wp = ft->wp; + struct grid_cell gc; + + tty_default_colours(&gc, wp); + return (xstrdup(colour_tostring(gc.fg))); +} + +/* Callback for pane_bg. */ +static char * +format_cb_pane_bg(struct format_tree *ft) +{ + struct window_pane *wp = ft->wp; + struct grid_cell gc; + + tty_default_colours(&gc, wp); + return (xstrdup(colour_tostring(gc.bg))); +} + /* Callback for session_group_list. */ static char * format_cb_session_group_list(struct format_tree *ft) @@ -3195,6 +3217,8 @@ !!(wp->base.mode & MODE_MOUSE_SGR)); format_add_cb(ft, "pane_tabs", format_cb_pane_tabs); + format_add_cb(ft, "pane_fg", format_cb_pane_fg); + format_add_cb(ft, "pane_bg", format_cb_pane_bg); } /* Set default format keys for paste buffer. */