summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/spawn.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-03-31 17:14:40 +0000
committernicm <nicm@openbsd.org>2020-03-31 17:14:40 +0000
commitd6f6a5d22f7b4169161e9056890b99e32b72e5e9 (patch)
treec66b9cb6b86fed17382e1ca23270b11fc655c4eb /usr.bin/tmux/spawn.c
parentAdd a -T flag to resize-pane to trim lines below the cursor, moving (diff)
downloadwireguard-openbsd-d6f6a5d22f7b4169161e9056890b99e32b72e5e9.tar.xz
wireguard-openbsd-d6f6a5d22f7b4169161e9056890b99e32b72e5e9.zip
Add a way to mark environment variables as "hidden" so they can be used
by tmux but are not passed into the environment of new panes.
Diffstat (limited to 'usr.bin/tmux/spawn.c')
-rw-r--r--usr.bin/tmux/spawn.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/spawn.c b/usr.bin/tmux/spawn.c
index f6d3f7e07a4..646541ce373 100644
--- a/usr.bin/tmux/spawn.c
+++ b/usr.bin/tmux/spawn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spawn.c,v 1.18 2020/03/31 06:35:38 nicm Exp $ */
+/* $OpenBSD: spawn.c,v 1.19 2020/03/31 17:14:40 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -303,7 +303,7 @@ spawn_pane(struct spawn_context *sc, char **cause)
child = environ_for_session(s, 0);
if (sc->environ != NULL)
environ_copy(sc->environ, child);
- environ_set(child, "TMUX_PANE", "%%%u", new_wp->id);
+ environ_set(child, "TMUX_PANE", 0, "%%%u", new_wp->id);
/*
* Then the PATH environment variable. The session one is replaced from
@@ -313,10 +313,10 @@ spawn_pane(struct spawn_context *sc, char **cause)
if (c != NULL && c->session == NULL) { /* only unattached clients */
ee = environ_find(c->environ, "PATH");
if (ee != NULL)
- environ_set(child, "PATH", "%s", ee->value);
+ environ_set(child, "PATH", 0, "%s", ee->value);
}
if (environ_find(child, "PATH") == NULL)
- environ_set(child, "%s", _PATH_DEFPATH);
+ environ_set(child, "PATH", 0, "%s", _PATH_DEFPATH);
/* Then the shell. If respawning, use the old one. */
if (~sc->flags & SPAWN_RESPAWN) {
@@ -326,7 +326,7 @@ spawn_pane(struct spawn_context *sc, char **cause)
free(new_wp->shell);
new_wp->shell = xstrdup(tmp);
}
- environ_set(child, "SHELL", "%s", new_wp->shell);
+ environ_set(child, "SHELL", 0, "%s", new_wp->shell);
/* Log the arguments we are going to use. */
log_debug("%s: shell=%s", __func__, new_wp->shell);