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

Diff for /src/usr.bin/tmux/cmd-respawn-window.c between version 1.16 and 1.17

version 1.16, 2012/07/11 07:10:15 version 1.17, 2013/03/24 09:54:10
Line 27 
Line 27 
  * Respawn a window (restart the command). Kill existing if -k given.   * Respawn a window (restart the command). Kill existing if -k given.
  */   */
   
 enum cmd_retval  cmd_respawn_window_exec(struct cmd *, struct cmd_ctx *);  enum cmd_retval  cmd_respawn_window_exec(struct cmd *, struct cmd_q *);
   
 const struct cmd_entry cmd_respawn_window_entry = {  const struct cmd_entry cmd_respawn_window_entry = {
         "respawn-window", "respawnw",          "respawn-window", "respawnw",
Line 40 
Line 40 
 };  };
   
 enum cmd_retval  enum cmd_retval
 cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)  cmd_respawn_window_exec(struct cmd *self, struct cmd_q *cmdq)
 {  {
         struct args             *args = self->args;          struct args             *args = self->args;
         struct winlink          *wl;          struct winlink          *wl;
Line 51 
Line 51 
         const char              *cmd;          const char              *cmd;
         char                    *cause;          char                    *cause;
   
         if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL)          if ((wl = cmd_find_window(cmdq, args_get(args, 't'), &s)) == NULL)
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
         w = wl->window;          w = wl->window;
   
Line 59 
Line 59 
                 TAILQ_FOREACH(wp, &w->panes, entry) {                  TAILQ_FOREACH(wp, &w->panes, entry) {
                         if (wp->fd == -1)                          if (wp->fd == -1)
                                 continue;                                  continue;
                         ctx->error(ctx,                          cmdq_error(cmdq,
                             "window still active: %s:%d", s->name, wl->idx);                              "window still active: %s:%d", s->name, wl->idx);
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
Line 81 
Line 81 
         else          else
                 cmd = NULL;                  cmd = NULL;
         if (window_pane_spawn(wp, cmd, NULL, NULL, &env, s->tio, &cause) != 0) {          if (window_pane_spawn(wp, cmd, NULL, NULL, &env, s->tio, &cause) != 0) {
                 ctx->error(ctx, "respawn window failed: %s", cause);                  cmdq_error(cmdq, "respawn window failed: %s", cause);
                 free(cause);                  free(cause);
                 environ_free(&env);                  environ_free(&env);
                 server_destroy_pane(wp);                  server_destroy_pane(wp);

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17