=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-list-panes.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/tmux/cmd-list-panes.c 2011/04/05 19:37:01 1.10 --- src/usr.bin/tmux/cmd-list-panes.c 2011/07/04 14:04:40 1.11 *************** *** 1,4 **** ! /* $OpenBSD: cmd-list-panes.c,v 1.10 2011/04/05 19:37:01 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-list-panes.c,v 1.11 2011/07/04 14:04:40 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 29,36 **** int cmd_list_panes_exec(struct cmd *, struct cmd_ctx *); void cmd_list_panes_server(struct cmd_ctx *); ! void cmd_list_panes_session(struct session *, struct cmd_ctx *); ! void cmd_list_panes_window(struct winlink *, struct cmd_ctx *); const struct cmd_entry cmd_list_panes_entry = { "list-panes", "lsp", --- 29,37 ---- int cmd_list_panes_exec(struct cmd *, struct cmd_ctx *); void cmd_list_panes_server(struct cmd_ctx *); ! void cmd_list_panes_session(struct session *, struct cmd_ctx *, int); ! void cmd_list_panes_window( ! struct session *, struct winlink *, struct cmd_ctx *, int); const struct cmd_entry cmd_list_panes_entry = { "list-panes", "lsp", *************** *** 55,66 **** s = cmd_find_session(ctx, args_get(args, 't'), 0); if (s == NULL) return (-1); ! cmd_list_panes_session(s, ctx); } else { ! wl = cmd_find_window(ctx, args_get(args, 't'), NULL); if (wl == NULL) return (-1); ! cmd_list_panes_window(wl, ctx); } return (0); --- 56,67 ---- s = cmd_find_session(ctx, args_get(args, 't'), 0); if (s == NULL) return (-1); ! cmd_list_panes_session(s, ctx, 1); } else { ! wl = cmd_find_window(ctx, args_get(args, 't'), &s); if (wl == NULL) return (-1); ! cmd_list_panes_window(s, wl, ctx, 0); } return (0); *************** *** 72,91 **** struct session *s; RB_FOREACH(s, sessions, &sessions) ! cmd_list_panes_session(s, ctx); } void ! cmd_list_panes_session(struct session *s, struct cmd_ctx *ctx) { struct winlink *wl; RB_FOREACH(wl, winlinks, &s->windows) ! cmd_list_panes_window(wl, ctx); } void ! cmd_list_panes_window(struct winlink *wl, struct cmd_ctx *ctx) { struct window_pane *wp; struct grid *gd; --- 73,93 ---- struct session *s; RB_FOREACH(s, sessions, &sessions) ! cmd_list_panes_session(s, ctx, 2); } void ! cmd_list_panes_session(struct session *s, struct cmd_ctx *ctx, int type) { struct winlink *wl; RB_FOREACH(wl, winlinks, &s->windows) ! cmd_list_panes_window(s, wl, ctx, type); } void ! cmd_list_panes_window( ! struct session *s, struct winlink *wl, struct cmd_ctx *ctx, int type) { struct window_pane *wp; struct grid *gd; *************** *** 105,115 **** } size += gd->hsize * sizeof *gd->linedata; ! ctx->print(ctx, ! "%u: [%ux%u] [history %u/%u, %llu bytes] %%%u%s%s", ! n, wp->sx, wp->sy, gd->hsize, gd->hlimit, size, wp->id, ! wp == wp->window->active ? " (active)" : "", ! wp->fd == -1 ? " (dead)" : ""); n++; } } --- 107,137 ---- } size += gd->hsize * sizeof *gd->linedata; ! switch (type) { ! case 0: ! ctx->print(ctx, ! "%u: [%ux%u] [history %u/%u, %llu bytes] %%%u%s%s", ! n, wp->sx, wp->sy, gd->hsize, gd->hlimit, size, ! wp->id, wp == wp->window->active ? " (active)" : "", ! wp->fd == -1 ? " (dead)" : ""); ! break; ! case 1: ! ctx->print(ctx, ! "%d.%u: [%ux%u] [history %u/%u, %llu bytes] " ! "%%%u%s%s", wl->idx, ! n, wp->sx, wp->sy, gd->hsize, gd->hlimit, size, ! wp->id, wp == wp->window->active ? " (active)" : "", ! wp->fd == -1 ? " (dead)" : ""); ! break; ! case 2: ! ctx->print(ctx, ! "%s:%d.%u: [%ux%u] [history %u/%u, %llu bytes] " ! "%%%u%s%s", s->name, wl->idx, ! n, wp->sx, wp->sy, gd->hsize, gd->hlimit, size, ! wp->id, wp == wp->window->active ? " (active)" : "", ! wp->fd == -1 ? " (dead)" : ""); ! break; ! } n++; } }