summaryrefslogtreecommitdiffstats
path: root/cmd-split-window.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-04-23 11:26:11 +0100
committerThomas Adam <thomas@xteddy.org>2014-04-23 11:26:11 +0100
commit953c3ef47a1933d38308075c1bacc7ea8d38301b (patch)
tree6484bdd51ecedbb5888717db271c151257ec87f5 /cmd-split-window.c
parent12e9c974fadc5ed6f0e7db10c40d5a0d55e0da8a (diff)
parent64613b9d411a7c76a50a2f9c66df345f082fce25 (diff)
Merge branch 'obsd-master'
Conflicts: Makefile tmux.1 window.c
Diffstat (limited to 'cmd-split-window.c')
-rw-r--r--cmd-split-window.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd-split-window.c b/cmd-split-window.c
index c43cb96b..9c4734be 100644
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@ -60,7 +60,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
struct window *w;
struct window_pane *wp, *new_wp = NULL;
struct environ env;
- const char *cmd, *shell, *template;
+ const char *cmd, *path, *shell, *template;
char *cause, *new_cause, *cp;
u_int hlimit;
int size, percentage, cwd, fd = -1;
@@ -68,6 +68,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
struct layout_cell *lc;
struct client *c;
struct format_tree *ft;
+ struct environ_entry *envent;
if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
return (CMD_RETURN_ERROR);
@@ -147,8 +148,17 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
goto error;
}
new_wp = window_add_pane(w, hlimit);
+
+ 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(
- new_wp, cmd, shell, cwd, &env, s->tio, &cause) != 0)
+ new_wp, cmd, path, shell, cwd, &env, s->tio, &cause) != 0)
goto error;
layout_assign_pane(lc, new_wp);