summaryrefslogtreecommitdiffstats
path: root/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'job.c')
-rw-r--r--job.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/job.c b/job.c
index caf5db52..7065a671 100644
--- a/job.c
+++ b/job.c
@@ -55,7 +55,12 @@ job_run(const char *cmd, struct session *s, const char *cwd,
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, out) != 0)
return (NULL);
- env = environ_for_session(s);
+ /*
+ * Do not set TERM during .tmux.conf, it is nice to be able to use
+ * if-shell to decide on default-terminal based on outside TERM.
+ */
+ env = environ_for_session(s, !cfg_finished);
+
switch (pid = fork()) {
case -1:
environ_free(env);