diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-18 14:40:48 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-18 14:40:48 +0000 |
commit | a15f8fc4a66420615d237313c6a01fcf532c52a2 (patch) | |
tree | 751d858639e20ae413ec907f7cf3215c06e3820d /server.c | |
parent | c4d5989a4ef03db0477446ee004ef431be268286 (diff) | |
download | rtmux-a15f8fc4a66420615d237313c6a01fcf532c52a2.tar.gz rtmux-a15f8fc4a66420615d237313c6a01fcf532c52a2.tar.bz2 rtmux-a15f8fc4a66420615d237313c6a01fcf532c52a2.zip |
Support command sequences separated by " ; ". Also clean up command printing.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.107 2009-01-18 12:09:42 nicm Exp $ */ +/* $Id: server.c,v 1.108 2009-01-18 14:40:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -587,7 +587,8 @@ server_handle_client(struct client *c) struct window_pane *wp; struct timeval tv; struct key_binding *bd; - int key, prefix, status, flags, xtimeout; + struct cmd *cmd; + int key, prefix, status, xtimeout, can_repeat; xtimeout = options_get_number(&c->session->options, "repeat-time"); if (xtimeout != 0 && c->flags & CLIENT_REPEAT) { @@ -636,10 +637,16 @@ server_handle_client(struct client *c) } continue; } - flags = bd->cmd->entry->flags; + + /* Check repeat flag. */ + can_repeat = 1; + TAILQ_FOREACH(cmd, bd->cmdlist, qentry) { + if (!(cmd->entry->flags & CMD_CANREPEAT)) + can_repeat = 0; + } /* If already repeating, but this key can't repeat, skip it. */ - if (c->flags & CLIENT_REPEAT && !(flags & CMD_CANREPEAT)) { + if (c->flags & CLIENT_REPEAT && !can_repeat) { c->flags &= ~CLIENT_REPEAT; if (key == prefix) c->flags |= CLIENT_PREFIX; @@ -649,7 +656,7 @@ server_handle_client(struct client *c) } /* If this key can repeat, reset the repeat flags and timer. */ - if (xtimeout != 0 && flags & CMD_CANREPEAT) { + if (xtimeout != 0 && can_repeat) { c->flags |= CLIENT_PREFIX|CLIENT_REPEAT; tv.tv_sec = xtimeout / 1000; |