Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-04-03 11:04:15 +01:00
6 changed files with 127 additions and 2 deletions

View File

@@ -2262,6 +2262,38 @@ format_cb_pane_pipe_pid(struct format_tree *ft)
return (value);
}
/* Callback for pane_pb_progress. */
static void *
format_cb_pane_pb_progress(struct format_tree *ft)
{
char *value = NULL;
if (ft->wp != NULL)
xasprintf(&value, "%d", ft->wp->base.progress_bar.progress);
return (value);
}
/* Callback for pane_pb_state. */
static void *
format_cb_pane_pb_state(struct format_tree *ft)
{
if (ft->wp != NULL) {
switch (ft->wp->base.progress_bar.state) {
case PROGRESS_BAR_HIDDEN:
return xstrdup("hidden");
case PROGRESS_BAR_NORMAL:
return xstrdup("normal");
case PROGRESS_BAR_ERROR:
return xstrdup("error");
case PROGRESS_BAR_INDETERMINATE:
return xstrdup("indeterminate");
case PROGRESS_BAR_PAUSED:
return xstrdup("paused");
}
}
return (NULL);
}
/* Callback for pane_right. */
static void *
format_cb_pane_right(struct format_tree *ft)
@@ -3349,6 +3381,12 @@ static const struct format_table_entry format_table[] = {
{ "pane_path", FORMAT_TABLE_STRING,
format_cb_pane_path
},
{ "pane_pb_progress", FORMAT_TABLE_STRING,
format_cb_pane_pb_progress
},
{ "pane_pb_state", FORMAT_TABLE_STRING,
format_cb_pane_pb_state
},
{ "pane_pid", FORMAT_TABLE_STRING,
format_cb_pane_pid
},