mirror of
https://github.com/tmux/tmux.git
synced 2026-06-21 09:45:41 +00:00
Extend client mode so the preview can be changed to a view with a
summary of the client terminal and its features, intended to make troubleshooting easier. "choose-client -i" or the "i" key in the mode.
This commit is contained in:
14
mode-tree.c
14
mode-tree.c
@@ -49,6 +49,7 @@ struct mode_tree_data {
|
||||
const struct menu_item *menu;
|
||||
|
||||
struct sort_criteria sort_crit;
|
||||
const char *view_name;
|
||||
|
||||
mode_tree_build_cb buildcb;
|
||||
mode_tree_draw_cb drawcb;
|
||||
@@ -700,6 +701,12 @@ mode_tree_add(struct mode_tree_data *mtd, struct mode_tree_item *parent,
|
||||
return (mti);
|
||||
}
|
||||
|
||||
void
|
||||
mode_tree_view_name(struct mode_tree_data *mtd, const char *name)
|
||||
{
|
||||
mtd->view_name = name;
|
||||
}
|
||||
|
||||
void
|
||||
mode_tree_draw_as_parent(struct mode_tree_item *mti)
|
||||
{
|
||||
@@ -884,9 +891,12 @@ mode_tree_draw(struct mode_tree_data *mtd)
|
||||
screen_write_box(&ctx, w, sy - h, BOX_LINES_DEFAULT, NULL, NULL);
|
||||
|
||||
if (mtd->sort_crit.order_seq != NULL) {
|
||||
xasprintf(&text, " %s (sort: %s%s)", mti->name,
|
||||
xasprintf(&text, " %s (sort: %s%s)%s%s%s", mti->name,
|
||||
sort_order_to_string(mtd->sort_crit.order),
|
||||
mtd->sort_crit.reversed ? ", reversed" : "");
|
||||
mtd->sort_crit.reversed ? ", reversed" : "",
|
||||
mtd->view_name == NULL ? "" : " (view: ",
|
||||
mtd->view_name == NULL ? "" : mtd->view_name,
|
||||
mtd->view_name == NULL ? "" : ")");
|
||||
} else
|
||||
xasprintf(&text, " %s", mti->name);
|
||||
if (w - 2 >= strlen(text)) {
|
||||
|
||||
Reference in New Issue
Block a user