[BACK]Return to cmd-list-windows.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/cmd-list-windows.c between version 1.13 and 1.14

version 1.13, 2011/04/05 19:37:01 version 1.14, 2011/07/04 14:04:40
Line 29 
Line 29 
 int     cmd_list_windows_exec(struct cmd *, struct cmd_ctx *);  int     cmd_list_windows_exec(struct cmd *, struct cmd_ctx *);
   
 void    cmd_list_windows_server(struct cmd_ctx *);  void    cmd_list_windows_server(struct cmd_ctx *);
 void    cmd_list_windows_session(struct session *, struct cmd_ctx *);  void    cmd_list_windows_session(struct session *, struct cmd_ctx *, int);
   
 const struct cmd_entry cmd_list_windows_entry = {  const struct cmd_entry cmd_list_windows_entry = {
         "list-windows", "lsw",          "list-windows", "lsw",
Line 53 
Line 53 
                 s = cmd_find_session(ctx, args_get(args, 't'), 0);                  s = cmd_find_session(ctx, args_get(args, 't'), 0);
                 if (s == NULL)                  if (s == NULL)
                         return (-1);                          return (-1);
                 cmd_list_windows_session(s, ctx);                  cmd_list_windows_session(s, ctx, 0);
         }          }
   
         return (0);          return (0);
Line 65 
Line 65 
         struct session  *s;          struct session  *s;
   
         RB_FOREACH(s, sessions, &sessions)          RB_FOREACH(s, sessions, &sessions)
                 cmd_list_windows_session(s, ctx);                  cmd_list_windows_session(s, ctx, 1);
 }  }
   
 void  void
 cmd_list_windows_session(struct session *s, struct cmd_ctx *ctx)  cmd_list_windows_session(struct session *s, struct cmd_ctx *ctx, int type)
 {  {
         struct winlink  *wl;          struct winlink  *wl;
         char            *layout;          char            *layout;
   
         RB_FOREACH(wl, winlinks, &s->windows) {          RB_FOREACH(wl, winlinks, &s->windows) {
                 layout = layout_dump(wl->window);                  layout = layout_dump(wl->window);
                 ctx->print(ctx, "%d: %s [%ux%u] [layout %s]%s",                  if (type) {
                     wl->idx, wl->window->name, wl->window->sx, wl->window->sy,                          ctx->print(ctx, "%s:%d: %s [%ux%u] [layout %s]%s",
                     layout, wl == s->curw ? " (active)" : "");                              s->name, wl->idx, wl->window->name, wl->window->sx,
                               wl->window->sy, layout,
                               wl == s->curw ? " (active)" : "");
                   } else {
                           ctx->print(ctx, "%d: %s [%ux%u] [layout %s]%s",
                               wl->idx, wl->window->name, wl->window->sx,
                               wl->window->sy, layout,
                               wl == s->curw ? " (active)" : "");
                   }
                 xfree(layout);                  xfree(layout);
         }          }
 }  }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14