summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/popup.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-10-11 10:55:32 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-10-11 10:55:32 +0000
commit0438c56b034e2c55a51d27f64912e3ee08720cf2 (patch)
tree8b04b95e88f7f4c7da85d4313671fcb43d23ecc4 /usr.bin/tmux/popup.c
parent8bbbf36012386412d273bf7fc5d9a54a6e9b31ed (diff)
Add -e flag to set environment for popup, from Alexis Hildebrandt in
GitHub issue 2924.
Diffstat (limited to 'usr.bin/tmux/popup.c')
-rw-r--r--usr.bin/tmux/popup.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/tmux/popup.c b/usr.bin/tmux/popup.c
index 8864da0dc76..76f9e4c8d99 100644
--- a/usr.bin/tmux/popup.c
+++ b/usr.bin/tmux/popup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popup.c,v 1.34 2021/08/17 08:22:44 nicm Exp $ */
+/* $OpenBSD: popup.c,v 1.35 2021/10/11 10:55:30 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -590,8 +590,9 @@ popup_job_complete_cb(struct job *job)
int
popup_display(int flags, struct cmdq_item *item, u_int px, u_int py, u_int sx,
- u_int sy, const char *shellcmd, int argc, char **argv, const char *cwd,
- struct client *c, struct session *s, popup_close_cb cb, void *arg)
+ u_int sy, struct environ *env, const char *shellcmd, int argc, char **argv,
+ const char *cwd, struct client *c, struct session *s, popup_close_cb cb,
+ void *arg)
{
struct popup_data *pd;
u_int jx, jy;
@@ -635,7 +636,7 @@ popup_display(int flags, struct cmdq_item *item, u_int px, u_int py, u_int sx,
pd->psx = sx;
pd->psy = sy;
- pd->job = job_run(shellcmd, argc, argv, s, cwd,
+ pd->job = job_run(shellcmd, argc, argv, env, s, cwd,
popup_job_update_cb, popup_job_complete_cb, NULL, pd,
JOB_NOWAIT|JOB_PTY|JOB_KEEPWRITE, jx, jy);
pd->ictx = input_init(NULL, job_get_event(pd->job), &pd->palette);
@@ -725,7 +726,7 @@ popup_editor(struct client *c, const char *buf, size_t len,
xasprintf(&cmd, "%s %s", editor, path);
if (popup_display(POPUP_INTERNAL|POPUP_CLOSEEXIT, NULL, px, py, sx, sy,
- cmd, 0, NULL, _PATH_TMP, c, NULL, popup_editor_close_cb, pe) != 0) {
+ NULL, cmd, 0, NULL, _PATH_TMP, c, NULL, popup_editor_close_cb, pe) != 0) {
popup_editor_free(pe);
free(cmd);
return (-1);