summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-01-23 11:03:43 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-01-23 11:03:43 +0000
commitb8023044c35f3099e67793e3573e9e001a43b1fe (patch)
tree2b08003a9370566d0fd6b32be7a1f02b96caf1a2 /cmd.c
parent1377427e708f23275c40a7b86d999bf6f8dd4a94 (diff)
Set $TMUX without the session when background jobs are run.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd.c b/cmd.c
index 6c4a06f4..5333a023 100644
--- a/cmd.c
+++ b/cmd.c
@@ -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);