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

Diff for /src/usr.bin/tmux/cmd-respawn-pane.c between version 1.25 and 1.26

version 1.25, 2017/04/25 15:35:10 version 1.26, 2017/07/21 09:17:19
Line 34 
Line 34 
         .name = "respawn-pane",          .name = "respawn-pane",
         .alias = "respawnp",          .alias = "respawnp",
   
         .args = { "kt:", 0, -1 },          .args = { "c:kt:", 0, -1 },
         .usage = "[-k] " CMD_TARGET_PANE_USAGE " [command]",          .usage = "[-c start-directory] [-k] " CMD_TARGET_PANE_USAGE
                    " [command]",
   
         .target = { 't', CMD_FIND_PANE, 0 },          .target = { 't', CMD_FIND_PANE, 0 },
   
Line 50 
Line 51 
         struct winlink          *wl = item->target.wl;          struct winlink          *wl = item->target.wl;
         struct window           *w = wl->window;          struct window           *w = wl->window;
         struct window_pane      *wp = item->target.wp;          struct window_pane      *wp = item->target.wp;
           struct client           *c = cmd_find_client(item, NULL, 1);
         struct session          *s = item->target.s;          struct session          *s = item->target.s;
         struct environ          *env;          struct environ          *env;
         const char              *path;          const char              *path = NULL, *cp;
         char                    *cause;          char                    *cause, *cwd = NULL;
         u_int                    idx;          u_int                    idx;
         struct environ_entry    *envent;          struct environ_entry    *envent;
   
Line 69 
Line 71 
         screen_reinit(&wp->base);          screen_reinit(&wp->base);
         input_init(wp);          input_init(wp);
   
         path = NULL;  
         if (item->client != NULL && item->client->session == NULL)          if (item->client != NULL && item->client->session == NULL)
                 envent = environ_find(item->client->environ, "PATH");                  envent = environ_find(item->client->environ, "PATH");
         else          else
Line 77 
Line 78 
         if (envent != NULL)          if (envent != NULL)
                 path = envent->value;                  path = envent->value;
   
           if ((cp = args_get(args, 'c')) != NULL)
                   cwd = format_single(item, cp, c, s, NULL, NULL);
   
         env = environ_for_session(s, 0);          env = environ_for_session(s, 0);
         if (window_pane_spawn(wp, args->argc, args->argv, path, NULL, NULL, env,          if (window_pane_spawn(wp, args->argc, args->argv, path, NULL, cwd, env,
             s->tio, &cause) != 0) {              s->tio, &cause) != 0) {
                 cmdq_error(item, "respawn pane failed: %s", cause);                  cmdq_error(item, "respawn pane failed: %s", cause);
                 free(cause);                  free(cause);
                 environ_free(env);                  environ_free(env);
                   free(cwd);
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
         }          }
         environ_free(env);          environ_free(env);
           free(cwd);
   
         wp->flags |= PANE_REDRAW;          wp->flags |= PANE_REDRAW;
         server_status_window(w);          server_status_window(w);

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26