summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-07-11 07:10:16 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-07-11 07:10:16 +0000
commit156a018a1068e24b3e4fe3c282d9f7c23218f83d (patch)
treed810dc12ac531587df2b51a4c4a39e577eb803d0 /usr.bin/tmux/server-client.c
parent5fbceaea80d4bc47fc3ffb9f184c6b478e3b16d1 (diff)
Make command exec functions return an enum rather than -1/0/1 values and
add a new value to mean "leave client running but don't attach" to fix problems with using some commands in a command sequence. Most of the work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index db8e357fcac..ca937bd8549 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.77 2012/07/10 11:53:01 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.78 2012/07/11 07:10:15 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -868,8 +868,16 @@ server_client_msg_command(struct client *c, struct msg_command_data *data)
}
cmd_free_argv(argc, argv);
- if (cmd_list_exec(cmdlist, &ctx) != 1)
+ switch (cmd_list_exec(cmdlist, &ctx))
+ {
+ case CMD_RETURN_ERROR:
+ case CMD_RETURN_NORMAL:
c->flags |= CLIENT_EXIT;
+ break;
+ case CMD_RETURN_ATTACH:
+ case CMD_RETURN_YIELD:
+ break;
+ }
cmd_list_free(cmdlist);
return;