diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-02 21:08:36 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-02 21:08:36 +0000 |
commit | a26f58c7c394f81c523da597f85f69d3fc8bc8ad (patch) | |
tree | 869e58ba4df84531d550002ccb2a856ed5db2577 /cmd-has-session.c | |
parent | f6b86402c7fd1f4af0e4d163f22e4b9f71b2e538 (diff) | |
download | rtmux-a26f58c7c394f81c523da597f85f69d3fc8bc8ad.tar.gz rtmux-a26f58c7c394f81c523da597f85f69d3fc8bc8ad.tar.bz2 rtmux-a26f58c7c394f81c523da597f85f69d3fc8bc8ad.zip |
Last bits of basic configuration file. By default in ~/.tmux.conf or specified with -f. Just a list of tmux commands executed when the server is started and before and any session/window is created.
Diffstat (limited to 'cmd-has-session.c')
-rw-r--r-- | cmd-has-session.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/cmd-has-session.c b/cmd-has-session.c index b7d14a48..ff724d4a 100644 --- a/cmd-has-session.c +++ b/cmd-has-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-has-session.c,v 1.4 2008-06-02 18:08:16 nicm Exp $ */ +/* $Id: cmd-has-session.c,v 1.5 2008-06-02 21:08:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -24,27 +24,30 @@ #include "tmux.h" /* - * Cause client to exit with 0 if session exists, or 1 if it doesn't. This - * is handled in the caller since this doesn't have flag CMD_NOSESSION, so - * all that is necessary is to exit. + * Cause client to report an error and exit with 1 if session doesn't exist. */ void cmd_has_session_exec(void *, struct cmd_ctx *); const struct cmd_entry cmd_has_session_entry = { "has-session", "has", - "", + CMD_SESSIONONLY_USAGE, 0, - NULL, + cmd_sessiononly_parse, cmd_has_session_exec, - NULL, - NULL, - NULL + cmd_sessiononly_send, + cmd_sessiononly_recv, + cmd_sessiononly_free }; void -cmd_has_session_exec(unused void *ptr, struct cmd_ctx *ctx) +cmd_has_session_exec(void *ptr, struct cmd_ctx *ctx) { + struct session *s; + + if ((s = cmd_sessiononly_get(ptr, ctx)) == NULL) + return; + if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); } |