summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2011-01-23 11:03:43 +0000
committernicm <nicm@openbsd.org>2011-01-23 11:03:43 +0000
commit07bd7bef9493f9e11e3fac393166c62539ae6f73 (patch)
tree40976d811ff847e03db2b73a1e405aec3f8abd51 /usr.bin/tmux/cmd.c
parentAnsify functions. (diff)
downloadwireguard-openbsd-07bd7bef9493f9e11e3fac393166c62539ae6f73.tar.xz
wireguard-openbsd-07bd7bef9493f9e11e3fac393166c62539ae6f73.zip
Set $TMUX without the session when background jobs are run.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r--usr.bin/tmux/cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c
index 84346402b5c..f56358ab34d 100644
--- a/usr.bin/tmux/cmd.c
+++ b/usr.bin/tmux/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.49 2011/01/04 00:42:47 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.50 2011/01/23 11:03:43 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -356,7 +356,7 @@ cmd_current_session(struct cmd_ctx *ctx)
}
/* Use the session from the TMUX environment variable. */
- if (data != NULL && data->pid == getpid()) {
+ if (data != NULL && data->pid == getpid() && data->idx != -1) {
s = session_find_by_index(data->idx);
if (s != NULL)
return (s);