=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window.c,v retrieving revision 1.106 retrieving revision 1.107 diff -c -r1.106 -r1.107 *** src/usr.bin/tmux/window.c 2014/04/17 11:38:35 1.106 --- src/usr.bin/tmux/window.c 2014/04/17 13:02:59 1.107 *************** *** 1,4 **** ! /* $OpenBSD: window.c,v 1.106 2014/04/17 11:38:35 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window.c,v 1.107 2014/04/17 13:02:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 308,315 **** } struct window * ! window_create(const char *name, const char *cmd, const char *shell, ! int cwd, struct environ *env, struct termios *tio, u_int sx, u_int sy, u_int hlimit, char **cause) { struct window *w; --- 308,315 ---- } struct window * ! window_create(const char *name, const char *cmd, const char *path, ! const char *shell, int cwd, struct environ *env, struct termios *tio, u_int sx, u_int sy, u_int hlimit, char **cause) { struct window *w; *************** *** 319,325 **** wp = window_add_pane(w, hlimit); layout_init(w, wp); ! if (window_pane_spawn(wp, cmd, shell, cwd, env, tio, cause) != 0) { window_destroy(w); return (NULL); } --- 319,326 ---- wp = window_add_pane(w, hlimit); layout_init(w, wp); ! if (window_pane_spawn(wp, cmd, path, shell, cwd, env, tio, ! cause) != 0) { window_destroy(w); return (NULL); } *************** *** 810,817 **** } int ! window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, ! int cwd, struct environ *env, struct termios *tio, char **cause) { struct winsize ws; char *argv0, paneid[16]; --- 811,819 ---- } int ! window_pane_spawn(struct window_pane *wp, const char *cmd, const char *path, ! const char *shell, int cwd, struct environ *env, struct termios *tio, ! char **cause) { struct winsize ws; char *argv0, paneid[16]; *************** *** 860,865 **** --- 862,869 ---- closefrom(STDERR_FILENO + 1); + if (path != NULL) + environ_set(env, "PATH", path); xsnprintf(paneid, sizeof paneid, "%%%u", wp->id); environ_set(env, "TMUX_PANE", paneid); environ_push(env);