mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Store state shared between multiple commands in the queue in a shared
structure.
This commit is contained in:
@ -65,6 +65,7 @@ static enum cmd_retval
|
||||
cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item)
|
||||
{
|
||||
struct args *args = self->args;
|
||||
struct cmdq_shared *shared = item->shared;
|
||||
struct cmd_if_shell_data *cdata;
|
||||
char *shellcmd, *cmd, *cause;
|
||||
struct cmd_list *cmdlist;
|
||||
@ -100,7 +101,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item)
|
||||
}
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
new_item = cmdq_get_command(cmdlist, NULL, &item->mouse, 0);
|
||||
new_item = cmdq_get_command(cmdlist, NULL, &shared->mouse, 0);
|
||||
cmdq_insert_after(item, new_item);
|
||||
cmd_list_free(cmdlist);
|
||||
return (CMD_RETURN_NORMAL);
|
||||
@ -125,7 +126,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item)
|
||||
cdata->item = item;
|
||||
else
|
||||
cdata->item = NULL;
|
||||
memcpy(&cdata->mouse, &item->mouse, sizeof cdata->mouse);
|
||||
memcpy(&cdata->mouse, &shared->mouse, sizeof cdata->mouse);
|
||||
|
||||
job_run(shellcmd, s, cwd, NULL, cmd_if_shell_callback,
|
||||
cmd_if_shell_free, cdata);
|
||||
|
Reference in New Issue
Block a user