summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/control.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 11:35:56 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 11:35:56 +0000
commitfc3ca5188f1a2cc580085a29c3ec52c1b8bcc16d (patch)
tree465864d16f9baf92ae2a8ffa97988db6a9d9265b /usr.bin/tmux/control.c
parent6dec153c674794298c76c4fd46b96ba1e2cbecfb (diff)
Add time and a command count to control mode guards, based on code from
George Nachman.
Diffstat (limited to 'usr.bin/tmux/control.c')
-rw-r--r--usr.bin/tmux/control.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/tmux/control.c b/usr.bin/tmux/control.c
index b9f8d3a0257..2f4f59e906f 100644
--- a/usr.bin/tmux/control.c
+++ b/usr.bin/tmux/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.8 2013/03/24 09:54:10 nicm Exp $ */
+/* $OpenBSD: control.c,v 1.9 2013/03/25 11:35:55 nicm Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -68,8 +68,13 @@ control_callback(struct client *c, int closed, unused void *data)
}
if (cmd_string_parse(line, &cmdlist, NULL, 0, &cause) != 0) {
- control_write(c, "%%error in line \"%s\": %s", line,
- cause);
+ c->cmdq->time = time(NULL);
+ c->cmdq->number++;
+
+ cmdq_guard(c->cmdq, "begin");
+ control_write(c, "parse error: %s", cause);
+ cmdq_guard(c->cmdq, "error");
+
free(cause);
} else {
cmdq_run(c->cmdq, cmdlist);