[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.78 and 1.79

version 1.78, 2019/04/26 11:38:51 version 1.79, 2019/04/28 20:05:50
Line 38 
Line 38 
         .name = "new-window",          .name = "new-window",
         .alias = "neww",          .alias = "neww",
   
         .args = { "ac:dF:kn:Pt:", 0, -1 },          .args = { "ac:de:F:kn:Pt:", 0, -1 },
         .usage = "[-adkP] [-c start-directory] [-F format] [-n window-name] "          .usage = "[-adkP] [-c start-directory] [-e environment] [-F format] "
                  CMD_TARGET_WINDOW_USAGE " [command]",                   "[-n window-name] " CMD_TARGET_WINDOW_USAGE " [command]",
   
         .target = { 't', CMD_FIND_WINDOW, CMD_FIND_WINDOW_INDEX },          .target = { 't', CMD_FIND_WINDOW, CMD_FIND_WINDOW_INDEX },
   
Line 60 
Line 60 
         int                      idx = item->target.idx;          int                      idx = item->target.idx;
         struct winlink          *new_wl;          struct winlink          *new_wl;
         char                    *cause = NULL, *cp;          char                    *cause = NULL, *cp;
         const char              *template;          const char              *template, *add;
         struct cmd_find_state    fs;          struct cmd_find_state    fs;
           struct args_value       *value;
   
         if (args_has(args, 'a') && (idx = winlink_shuffle_up(s, wl)) == -1) {          if (args_has(args, 'a') && (idx = winlink_shuffle_up(s, wl)) == -1) {
                 cmdq_error(item, "couldn't get a window index");                  cmdq_error(item, "couldn't get a window index");
Line 75 
Line 76 
         sc.name = args_get(args, 'n');          sc.name = args_get(args, 'n');
         sc.argc = args->argc;          sc.argc = args->argc;
         sc.argv = args->argv;          sc.argv = args->argv;
           sc.environ = environ_create();
   
           add = args_first_value(args, 'e', &value);
           while (add != NULL) {
                   environ_put(sc.environ, add);
                   add = args_next_value(&value);
           }
   
         sc.idx = idx;          sc.idx = idx;
         sc.cwd = args_get(args, 'c');          sc.cwd = args_get(args, 'c');
   
Line 107 
Line 115 
         cmd_find_from_winlink(&fs, new_wl, 0);          cmd_find_from_winlink(&fs, new_wl, 0);
         cmdq_insert_hook(s, item, &fs, "after-new-window");          cmdq_insert_hook(s, item, &fs, "after-new-window");
   
           environ_free(sc.environ);
         return (CMD_RETURN_NORMAL);          return (CMD_RETURN_NORMAL);
 }  }

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79