summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-list-panes.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-10-15 07:05:39 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-10-15 07:05:39 +0000
commitcab5178e6c5063021c04043c533ba8fbdf9e1ad2 (patch)
tree56add4c3a2173a0b3fc96973d34c9d345e6e5dcb /usr.bin/tmux/cmd-list-panes.c
parent72393da30d8b1aca14045a254793d0e4dc5b5105 (diff)
The pane pty name isn't useful for anything so show the pane number instead.
Diffstat (limited to 'usr.bin/tmux/cmd-list-panes.c')
-rw-r--r--usr.bin/tmux/cmd-list-panes.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-list-panes.c b/usr.bin/tmux/cmd-list-panes.c
index 6308994a627..470af1968d1 100644
--- a/usr.bin/tmux/cmd-list-panes.c
+++ b/usr.bin/tmux/cmd-list-panes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-list-panes.c,v 1.1 2009/10/10 17:19:38 nicm Exp $ */
+/* $OpenBSD: cmd-list-panes.c,v 1.2 2009/10/15 07:05:38 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);