summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-01-23 11:03:44 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-01-23 11:03:44 +0000
commit7e53eabddc6979e4f6c798fee98409cafa0e6a25 (patch)
tree877554c66d5900dcd763f49038c660f468261669 /usr.bin/tmux/cmd.c
parent7e1a400591be74655347d8b7d61e848954408757 (diff)
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);