=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-respawn-pane.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/tmux/cmd-respawn-pane.c 2013/10/10 12:29:53 1.10 --- src/usr.bin/tmux/cmd-respawn-pane.c 2014/04/17 13:02:59 1.11 *************** *** 1,4 **** ! /* $OpenBSD: cmd-respawn-pane.c,v 1.10 2013/10/10 12:29:53 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-respawn-pane.c,v 1.11 2014/04/17 13:02:59 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 48,56 **** struct window_pane *wp; struct session *s; struct environ env; ! const char *cmd; char *cause; u_int idx; if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL) return (CMD_RETURN_ERROR); --- 48,57 ---- struct window_pane *wp; struct session *s; struct environ env; ! const char *cmd, *path; char *cause; u_int idx; + struct environ_entry *envent; if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL) return (CMD_RETURN_ERROR); *************** *** 77,83 **** cmd = args->argv[0]; else cmd = NULL; ! if (window_pane_spawn(wp, cmd, NULL, -1, &env, s->tio, &cause) != 0) { cmdq_error(cmdq, "respawn pane failed: %s", cause); free(cause); environ_free(&env); --- 78,94 ---- cmd = args->argv[0]; else cmd = NULL; ! ! path = NULL; ! if (cmdq->client != NULL && cmdq->client->session == NULL) ! envent = environ_find(&cmdq->client->environ, "PATH"); ! else ! envent = environ_find(&s->environ, "PATH"); ! if (envent != NULL) ! path = envent->value; ! ! if (window_pane_spawn(wp, cmd, path, NULL, -1, &env, s->tio, ! &cause) != 0) { cmdq_error(cmdq, "respawn pane failed: %s", cause); free(cause); environ_free(&env);