=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-list-panes.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/usr.bin/tmux/cmd-list-panes.c 2009/10/10 17:19:38 1.1 +++ src/usr.bin/tmux/cmd-list-panes.c 2009/10/15 07:05:38 1.2 @@ -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 @@ -47,13 +47,13 @@ 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 @@ } 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);