summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-new-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-08-13 19:16:15 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-08-13 19:16:15 +0000
commit24535a131a6a66462feb10a24366c2ae6c961229 (patch)
tree21db2b64aab5edd1c4ad399f85da6cf65fef8b6e /usr.bin/tmux/cmd-new-session.c
parent0f78dca5bc4c30620f10abaf3f6e069a89a51859 (diff)
Rather than telling the client to exit in the function when creating a new
session detached, let the caller do it. Allows "tmux new -d \; attach" to work.
Diffstat (limited to 'usr.bin/tmux/cmd-new-session.c')
-rw-r--r--usr.bin/tmux/cmd-new-session.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c
index c18905f55af..8cdc064345f 100644
--- a/usr.bin/tmux/cmd-new-session.c
+++ b/usr.bin/tmux/cmd-new-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-new-session.c,v 1.11 2009/08/13 19:03:59 nicm Exp $ */
+/* $OpenBSD: cmd-new-session.c,v 1.12 2009/08/13 19:16:14 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -239,8 +239,6 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
if (ctx->cmdclient != NULL) {
if (!detached)
server_write_client(ctx->cmdclient, MSG_READY, NULL, 0);
- else
- server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0);
}
/* Set the client to the new session. */
@@ -255,7 +253,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
}
recalculate_sizes();
- return (1); /* 1 means don't tell command client to exit */
+ return (!detached); /* 1 means don't tell command client to exit */
}
void