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

Diff for /src/usr.bin/tmux/cmd-new-window.c between version 1.20 and 1.21

version 1.20, 2012/01/31 15:52:21 version 1.21, 2012/03/04 20:50:53
Line 30 
Line 30 
   
 const struct cmd_entry cmd_new_window_entry = {  const struct cmd_entry cmd_new_window_entry = {
         "new-window", "neww",          "new-window", "neww",
         "ac:dkn:Pt:", 0, 1,          "ac:dF:kn:Pt:", 0, 1,
         "[-adk] [-c start-directory] [-n window-name] [-t target-window] "          "[-adkP] [-c start-directory] [-F format] [-n window-name] "
         "[command]",          "[-t target-window] [command]",
         0,          0,
         NULL,          NULL,
         NULL,          NULL,
Line 42 
Line 42 
 int  int
 cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)  cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
 {  {
         struct args     *args = self->args;          struct args             *args = self->args;
         struct session  *s;          struct session          *s;
         struct winlink  *wl;          struct winlink          *wl;
         const char      *cmd, *cwd;          struct client           *c;
         char            *cause;          const char              *cmd, *cwd;
         int              idx, last, detached;          const char              *template;
           char                    *cause;
           int                      idx, last, detached;
           struct format_tree      *ft;
           char                    *cp;
   
         if (args_has(args, 'a')) {          if (args_has(args, 'a')) {
                 wl = cmd_find_window(ctx, args_get(args, 't'), &s);                  wl = cmd_find_window(ctx, args_get(args, 't'), &s);
Line 116 
Line 120 
         } else          } else
                 server_status_session_group(s);                  server_status_session_group(s);
   
         if (args_has(args, 'P'))          if (args_has(args, 'P')) {
                 ctx->print(ctx, "%s:%u", s->name, wl->idx);                  template = "#{session_name}:#{window_index}";
                   if (args_has(args, 'F'))
                           template = args_get(args, 'F');
   
                   ft = format_create();
                   if ((c = cmd_find_client(ctx, NULL)) != NULL)
                       format_client(ft, c);
                   format_session(ft, s);
                   format_winlink(ft, s, wl);
   
                   cp = format_expand(ft, template);
                   ctx->print(ctx, "%s", cp);
                   free(cp);
   
                   format_free(ft);
           }
   
         return (0);          return (0);
 }  }

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21