summaryrefslogtreecommitdiffstats
path: root/cmd-list-panes.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-10-15 07:05:38 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-10-15 07:05:38 +0000
commitdba0d54cf537ebfd125aa17a20eb88ef266db9c1 (patch)
tree60bc7ab5d5e3fe4f8454f544499fcf6248ca74c6 /cmd-list-panes.c
parent1a3c334c753b9c22dc06105cc8009655bd9589c1 (diff)
The pane pty name isn't useful for anything so show the pane number instead.
Diffstat (limited to 'cmd-list-panes.c')
-rw-r--r--cmd-list-panes.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/cmd-list-panes.c b/cmd-list-panes.c
index 0dcf0009..5a06eb7a 100644
--- a/cmd-list-panes.c
+++ b/cmd-list-panes.c
@@ -47,13 +47,13 @@ cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx)
struct window_pane *wp;
struct grid *gd;
struct grid_line *gl;
- u_int i;
+ u_int i, n;
unsigned long long size;
- const char *name;
if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
return (-1);
+ n = 0;
TAILQ_FOREACH(wp, &wl->window->panes, entry) {
gd = wp->base.grid;
@@ -65,13 +65,9 @@ cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx)
}
size += gd->hsize * sizeof *gd->linedata;
- name = NULL;
- if (wp->fd != -1)
- name = ttyname(wp->fd);
- if (name == NULL)
- name = "unknown";
- ctx->print(ctx, "%s [%ux%u] [history %u/%u, %llu bytes]",
- name, wp->sx, wp->sy, gd->hsize, gd->hlimit, size);
+ ctx->print(ctx, "%u: [%ux%u] [history %u/%u, %llu bytes]",
+ n, wp->sx, wp->sy, gd->hsize, gd->hlimit, size);
+ n++;
}
return (0);