mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Add hooks infrastructure, basic commands (set-hook, show-hooks) and a
couple of not very useful client hooks. This will eventually let commands be run at various points and on notifications. Joint work with Thomas Adam.
This commit is contained in:
@ -72,9 +72,8 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
return (CMD_RETURN_ERROR);
|
||||
|
||||
TAILQ_FOREACH(cloop, &clients, entry) {
|
||||
if (cloop->session != s)
|
||||
continue;
|
||||
proc_send_s(cloop->peer, msgtype, cloop->session->name);
|
||||
if (cloop->session == s)
|
||||
server_client_detach(cloop, msgtype);
|
||||
}
|
||||
return (CMD_RETURN_STOP);
|
||||
}
|
||||
@ -85,13 +84,12 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
|
||||
if (args_has(args, 'a')) {
|
||||
TAILQ_FOREACH(cloop, &clients, entry) {
|
||||
if (cloop->session == NULL || cloop == c)
|
||||
continue;
|
||||
proc_send_s(cloop->peer, msgtype, cloop->session->name);
|
||||
if (cloop->session != NULL && cloop != c)
|
||||
server_client_detach(cloop, msgtype);
|
||||
}
|
||||
return (CMD_RETURN_NORMAL);
|
||||
}
|
||||
|
||||
proc_send_s(c->peer, msgtype, c->session->name);
|
||||
server_client_detach(c, msgtype);
|
||||
return (CMD_RETURN_STOP);
|
||||
}
|
||||
|
Reference in New Issue
Block a user