mirror of
https://github.com/tmux/tmux.git
synced 2026-04-16 03:56:28 +00:00
Merge branch 'obsd-master'
This commit is contained in:
38
format.c
38
format.c
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user