From a15f8fc4a66420615d237313c6a01fcf532c52a2 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 18 Jan 2009 14:40:48 +0000 Subject: Support command sequences separated by " ; ". Also clean up command printing. --- cmd-command-prompt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cmd-command-prompt.c') diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c index 72c13fd0..cdcbd424 100644 --- a/cmd-command-prompt.c +++ b/cmd-command-prompt.c @@ -1,4 +1,4 @@ -/* $Id: cmd-command-prompt.c,v 1.9 2009-01-14 22:16:56 nicm Exp $ */ +/* $Id: cmd-command-prompt.c,v 1.10 2009-01-18 14:40:48 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -60,7 +60,7 @@ cmd_command_prompt_init(struct cmd *self, int key) switch (key) { case ',': - data->arg = xstrdup("rename-window \"%%\""); + data->arg = xstrdup("rename-window '%%'"); break; } } @@ -102,7 +102,7 @@ cmd_command_prompt_callback(void *data, const char *s) { struct cmd_command_prompt_data *cdata = data; struct client *c = cdata->c; - struct cmd *cmd; + struct cmd_list *cmdlist; struct cmd_ctx ctx; char *cause, *ptr, *buf, ch; size_t len, slen; @@ -139,17 +139,17 @@ cmd_command_prompt_callback(void *data, const char *s) } xfree(cdata); - if (cmd_string_parse(s, &cmd, &cause) != 0) { + if (cmd_string_parse(s, &cmdlist, &cause) != 0) { if (cause == NULL) return (0); *cause = toupper((u_char) *cause); server_set_client_message(c, cause); xfree(cause); - cmd = NULL; + cmdlist = NULL; } if (buf != NULL) xfree(buf); - if (cmd == NULL) + if (cmdlist == NULL) return (0); ctx.msgdata = NULL; @@ -162,7 +162,7 @@ cmd_command_prompt_callback(void *data, const char *s) ctx.cmdclient = NULL; - cmd_exec(cmd, &ctx); + cmd_list_exec(cmdlist, &ctx); if (c->prompt_callback != (void *) &cmd_command_prompt_callback) return (1); -- cgit