[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.43 and 1.44

version 1.43, 2017/05/01 12:20:55 version 1.44, 2020/04/12 08:36:18
Line 49 
Line 49 
         .name = "list-windows",          .name = "list-windows",
         .alias = "lsw",          .alias = "lsw",
   
         .args = { "F:at:", 0, 0 },          .args = { "F:f:at:", 0, 0 },
         .usage = "[-a] [-F format] " CMD_TARGET_SESSION_USAGE,          .usage = "[-a] [-F format] [-f filter] " CMD_TARGET_SESSION_USAGE,
   
         .target = { 't', CMD_FIND_SESSION, 0 },          .target = { 't', CMD_FIND_SESSION, 0 },
   
Line 88 
Line 88 
         struct winlink          *wl;          struct winlink          *wl;
         u_int                    n;          u_int                    n;
         struct format_tree      *ft;          struct format_tree      *ft;
         const char              *template;          const char              *template, *filter;
         char                    *line;          char                    *line, *expanded;
           int                      flag;
   
         template = args_get(args, 'F');          template = args_get(args, 'F');
         if (template == NULL) {          if (template == NULL) {
Line 102 
Line 103 
                         break;                          break;
                 }                  }
         }          }
           filter = args_get(args, 'f');
   
         n = 0;          n = 0;
         RB_FOREACH(wl, winlinks, &s->windows) {          RB_FOREACH(wl, winlinks, &s->windows) {
Line 109 
Line 111 
                 format_add(ft, "line", "%u", n);                  format_add(ft, "line", "%u", n);
                 format_defaults(ft, NULL, s, wl, NULL);                  format_defaults(ft, NULL, s, wl, NULL);
   
                 line = format_expand(ft, template);                  if (filter != NULL) {
                 cmdq_print(item, "%s", line);                          expanded = format_expand(ft, filter);
                 free(line);                          flag = format_true(expanded);
                           free(expanded);
                   } else
                           flag = 1;
                   if (flag) {
                           line = format_expand(ft, template);
                           cmdq_print(item, "%s", line);
                           free(line);
                   }
   
                 format_free(ft);                  format_free(ft);
                 n++;                  n++;

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44