summaryrefslogtreecommitdiffstats
path: root/job.c
diff options
context:
space:
mode:
authornicm <nicm>2021-10-11 10:55:30 +0000
committernicm <nicm>2021-10-11 10:55:30 +0000
commit759efe1b3327a7244c03ecc7b90e0e3c49712d06 (patch)
tree58e4302cb00b591f010c38a6871b1e9a779da5a3 /job.c
parent7800a431ea63f3be4f0763df3f3a2fae44aeac58 (diff)
Add -e flag to set environment for popup, from Alexis Hildebrandt in
GitHub issue 2924.
Diffstat (limited to 'job.c')
-rw-r--r--job.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/job.c b/job.c
index 66a25557..4c13f943 100644
--- a/job.c
+++ b/job.c
@@ -71,7 +71,7 @@ static LIST_HEAD(joblist, job) all_jobs = LIST_HEAD_INITIALIZER(all_jobs);
/* Start a job running. */
struct job *
-job_run(const char *cmd, int argc, char **argv, struct session *s,
+job_run(const char *cmd, int argc, char **argv, struct environ *e, struct session *s,
const char *cwd, job_update_cb updatecb, job_complete_cb completecb,
job_free_cb freecb, void *data, int flags, int sx, int sy)
{
@@ -89,6 +89,9 @@ job_run(const char *cmd, int argc, char **argv, struct session *s,
* if-shell to decide on default-terminal based on outside TERM.
*/
env = environ_for_session(s, !cfg_finished);
+ if (e != NULL) {
+ environ_copy(e, env);
+ }
sigfillset(&set);
sigprocmask(SIG_BLOCK, &set, &oldset);