Added status format functionality to panes along with flags

This commit is contained in:
Dane Jensen
2026-03-17 22:50:04 -07:00
parent ab0081294c
commit 08fd890a89
5 changed files with 107 additions and 2 deletions

View File

@@ -1004,6 +1004,15 @@ format_cb_pane_fg(struct format_tree *ft)
return (xstrdup(colour_tostring(gc.fg)));
}
/* Callback for pane_flags. */
static void *
format_cb_pane_flags(struct format_tree *ft)
{
if (ft->wp != NULL)
return (xstrdup(window_pane_printable_flags(ft->wp, 1)));
return (NULL);
}
/* Callback for pane_floating_flag. */
static void *
format_cb_pane_floating_flag(struct format_tree *ft)
@@ -2205,6 +2214,21 @@ format_cb_pane_marked_set(struct format_tree *ft)
return (NULL);
}
/* Callback for pane_minimised_flag. */
static void *
format_cb_pane_minimised_flag(struct format_tree *ft)
{
struct window_pane *wp = ft->wp;
if (wp != NULL) {
if (wp->flags & PANE_MINIMISED)
return (xstrdup("1"));
return (xstrdup("0"));
}
return (NULL);
}
/* Callback for pane_mode. */
static void *
format_cb_pane_mode(struct format_tree *ft)
@@ -2333,6 +2357,20 @@ format_cb_pane_width(struct format_tree *ft)
return (NULL);
}
/* Callback for pane_zoomed_flag. */
static void *
format_cb_pane_zoomed_flag(struct format_tree *ft)
{
struct window_pane *wp = ft->wp;
if (wp != NULL) {
if (wp->flags & PANE_ZOOMED)
return (xstrdup("1"));
return (xstrdup("0"));
}
return (NULL);
}
/* Callback for scroll_region_lower. */
static void *
format_cb_scroll_region_lower(struct format_tree *ft)
@@ -3309,6 +3347,9 @@ static const struct format_table_entry format_table[] = {
{ "pane_fg", FORMAT_TABLE_STRING,
format_cb_pane_fg
},
{ "pane_flags", FORMAT_TABLE_STRING,
format_cb_pane_flags
},
{ "pane_floating_flag", FORMAT_TABLE_STRING,
format_cb_pane_floating_flag
},
@@ -3345,6 +3386,9 @@ static const struct format_table_entry format_table[] = {
{ "pane_marked_set", FORMAT_TABLE_STRING,
format_cb_pane_marked_set
},
{ "pane_minimised_flag", FORMAT_TABLE_STRING,
format_cb_pane_minimised_flag
},
{ "pane_mode", FORMAT_TABLE_STRING,
format_cb_pane_mode
},
@@ -3393,6 +3437,9 @@ static const struct format_table_entry format_table[] = {
{ "pane_width", FORMAT_TABLE_STRING,
format_cb_pane_width
},
{ "pane_zoomed_flag", FORMAT_TABLE_STRING,
format_cb_pane_zoomed_flag
},
{ "pid", FORMAT_TABLE_STRING,
format_cb_pid
},