diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-16 21:12:31 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-16 21:12:31 +0000 |
commit | b359f9b594ccd945a245e429469d3c53fb6bf859 (patch) | |
tree | 56ea1db5c03062736f52775f4c45e16f51339eb0 /cmd-refresh-client.c | |
parent | 86b73cec72fc178cc612a60af2ac1d0aff3c10c5 (diff) | |
download | rtmux-b359f9b594ccd945a245e429469d3c53fb6bf859.tar.gz rtmux-b359f9b594ccd945a245e429469d3c53fb6bf859.tar.bz2 rtmux-b359f9b594ccd945a245e429469d3c53fb6bf859.zip |
Add -c option to specify client, and move detach/refresh to client rather than session.
Diffstat (limited to 'cmd-refresh-client.c')
-rw-r--r-- | cmd-refresh-client.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c new file mode 100644 index 00000000..ba2ce5bf --- /dev/null +++ b/cmd-refresh-client.c @@ -0,0 +1,48 @@ +/* $Id: cmd-refresh-client.c,v 1.1 2007-11-16 21:12:31 nicm Exp $ */ + +/* + * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include <sys/types.h> + +#include <getopt.h> + +#include "tmux.h" + +/* + * Refresh client. + */ + +void cmd_refresh_client_exec(void *, struct cmd_ctx *); + +const struct cmd_entry cmd_refresh_client_entry = { + "refresh-client", "refresh", "", + 0, + NULL, + cmd_refresh_client_exec, + NULL, + NULL, + NULL +}; + +void +cmd_refresh_client_exec(unused void *ptr, struct cmd_ctx *ctx) +{ + server_redraw_client(ctx->client); + + if (ctx->cmdclient != NULL) + server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); +} |