Add a skeleton mode to tmux (called "control mode") that let's tmux

commands be sent and output received on stdout. This can be used to
integrate with other terminal emulators and should allow some other
things to be made simpler later. More to come so doesn't do much yet and
deliberately not documented.
This commit is contained in:
Nicholas Marriott
2012-06-18 13:16:42 +00:00
parent 7c39850d1f
commit 2942eca895
8 changed files with 191 additions and 5 deletions

View File

@ -81,12 +81,24 @@ bad:
int
cmd_list_exec(struct cmd_list *cmdlist, struct cmd_ctx *ctx)
{
struct client *c = ctx->curclient;
struct cmd *cmd;
int n, retval;
int n, retval, guards;
guards = 0;
if (c != NULL && c->session != NULL)
guards = c->flags & CLIENT_CONTROL;
retval = 0;
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
if ((n = cmd_exec(cmd, ctx)) == -1)
if (guards)
ctx->print(ctx, "%%begin");
n = cmd_exec(cmd, ctx);
if (guards)
ctx->print(ctx, "%%end");
/* Return of -1 is an error. */
if (n == -1)
return (-1);
/*