Add -e flag to set environment for popup, from Alexis Hildebrandt in

GitHub issue 2924.
This commit is contained in:
nicm
2021-10-11 10:55:30 +00:00
parent 7800a431ea
commit 759efe1b33
9 changed files with 48 additions and 21 deletions

5
job.c
View File

@ -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);