diff options
author | 2014-04-17 13:02:59 +0000 | |
---|---|---|
committer | 2014-04-17 13:02:59 +0000 | |
commit | 1a0db3015ea731ed484e4af0811ff30aef5f77dc (patch) | |
tree | d4cc69063d740f9490fc4436cd841487c5c2d569 /usr.bin/tmux/window.c | |
parent | Wrap some long lines. (diff) | |
download | wireguard-openbsd-1a0db3015ea731ed484e4af0811ff30aef5f77dc.tar.xz wireguard-openbsd-1a0db3015ea731ed484e4af0811ff30aef5f77dc.zip |
Set PATH explicitly, either from client or session
environment. Previously it came from the session environment. From J
Raynor.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r-- | usr.bin/tmux/window.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 09eb4ae352c..e90d351e465 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.106 2014/04/17 11:38:35 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.107 2014/04/17 13:02:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -308,8 +308,8 @@ window_create1(u_int sx, u_int sy) } struct window * -window_create(const char *name, const char *cmd, const char *shell, - int cwd, struct environ *env, struct termios *tio, +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,7 +319,8 @@ window_create(const char *name, const char *cmd, const char *shell, wp = window_add_pane(w, hlimit); layout_init(w, wp); - if (window_pane_spawn(wp, cmd, shell, cwd, env, tio, cause) != 0) { + if (window_pane_spawn(wp, cmd, path, shell, cwd, env, tio, + cause) != 0) { window_destroy(w); return (NULL); } @@ -810,8 +811,9 @@ window_pane_destroy(struct window_pane *wp) } int -window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, - int cwd, struct environ *env, struct termios *tio, char **cause) +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,6 +862,8 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, 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); |