mirror of
https://github.com/tmux/tmux.git
synced 2025-01-27 16:48:49 +00:00
Sync OpenBSD patchset 980:
Add a pane_index format string and use it, from Ben Boeckel.
This commit is contained in:
parent
9ec457575d
commit
5cc3d50289
@ -102,21 +102,21 @@ cmd_list_panes_window(struct cmd *self,
|
|||||||
if (template == NULL) {
|
if (template == NULL) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0:
|
case 0:
|
||||||
template = "#{line}: "
|
template = "#{pane_index}: "
|
||||||
"[#{pane_width}x#{pane_height}] [history "
|
"[#{pane_width}x#{pane_height}] [history "
|
||||||
"#{history_size}/#{history_limit}, "
|
"#{history_size}/#{history_limit}, "
|
||||||
"#{history_bytes} bytes] #{pane_id}"
|
"#{history_bytes} bytes] #{pane_id}"
|
||||||
"#{?pane_active, (active),}#{?pane_dead, (dead),}";
|
"#{?pane_active, (active),}#{?pane_dead, (dead),}";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
template = "#{window_index}.#{line}: "
|
template = "#{window_index}.#{pane_index}: "
|
||||||
"[#{pane_width}x#{pane_height}] [history "
|
"[#{pane_width}x#{pane_height}] [history "
|
||||||
"#{history_size}/#{history_limit}, "
|
"#{history_size}/#{history_limit}, "
|
||||||
"#{history_bytes} bytes] #{pane_id}"
|
"#{history_bytes} bytes] #{pane_id}"
|
||||||
"#{?pane_active, (active),}#{?pane_dead, (dead),}";
|
"#{?pane_active, (active),}#{?pane_dead, (dead),}";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
template = "#{session_name}:#{window_index}.#{line}: "
|
template = "#{session_name}:#{window_index}.#{pane_index}: "
|
||||||
"[#{pane_width}x#{pane_height}] [history "
|
"[#{pane_width}x#{pane_height}] [history "
|
||||||
"#{history_size}/#{history_limit}, "
|
"#{history_size}/#{history_limit}, "
|
||||||
"#{history_bytes} bytes] #{pane_id}"
|
"#{history_bytes} bytes] #{pane_id}"
|
||||||
|
5
format.c
5
format.c
@ -361,6 +361,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
|
|||||||
struct grid_line *gl;
|
struct grid_line *gl;
|
||||||
unsigned long long size;
|
unsigned long long size;
|
||||||
u_int i;
|
u_int i;
|
||||||
|
u_int idx;
|
||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
for (i = 0; i < gd->hsize; i++) {
|
for (i = 0; i < gd->hsize; i++) {
|
||||||
@ -370,9 +371,13 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
|
|||||||
}
|
}
|
||||||
size += gd->hsize * sizeof *gd->linedata;
|
size += gd->hsize * sizeof *gd->linedata;
|
||||||
|
|
||||||
|
if (window_pane_index(wp, &idx) != 0)
|
||||||
|
fatalx("index not found");
|
||||||
|
|
||||||
format_add(ft, "pane_width", "%u", wp->sx);
|
format_add(ft, "pane_width", "%u", wp->sx);
|
||||||
format_add(ft, "pane_height", "%u", wp->sy);
|
format_add(ft, "pane_height", "%u", wp->sy);
|
||||||
format_add(ft, "pane_title", "%s", wp->base.title);
|
format_add(ft, "pane_title", "%s", wp->base.title);
|
||||||
|
format_add(ft, "pane_index", "%u", idx);
|
||||||
format_add(ft, "history_size", "%u", gd->hsize);
|
format_add(ft, "history_size", "%u", gd->hsize);
|
||||||
format_add(ft, "history_limit", "%u", gd->hlimit);
|
format_add(ft, "history_limit", "%u", gd->hlimit);
|
||||||
format_add(ft, "history_bytes", "%llu", size);
|
format_add(ft, "history_bytes", "%llu", size);
|
||||||
|
Loading…
Reference in New Issue
Block a user