mirror of
https://github.com/tmux/tmux.git
synced 2025-09-07 11:58:17 +00:00
Instead of sending all data to control mode clients as fast as possible,
add a limit of how much data will be sent to the client and try to use it for panes with some degree of fairness. GitHub issue 2217, with George Nachman.
This commit is contained in:
@@ -214,15 +214,20 @@ cmd_capture_pane_exec(struct cmd *self, struct cmdq_item *item)
|
||||
return (CMD_RETURN_ERROR);
|
||||
|
||||
if (args_has(args, 'p')) {
|
||||
if (!file_can_print(c)) {
|
||||
cmdq_error(item, "can't write output to client");
|
||||
free(buf);
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
file_print_buffer(c, buf, len);
|
||||
if (args_has(args, 'P') && len > 0)
|
||||
if (len > 0 && buf[len - 1] == '\n')
|
||||
len--;
|
||||
if (c->flags & CLIENT_CONTROL)
|
||||
control_write(c, "%.*s", (int)len, buf);
|
||||
else {
|
||||
if (!file_can_print(c)) {
|
||||
cmdq_error(item, "can't write to client");
|
||||
free(buf);
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
file_print_buffer(c, buf, len);
|
||||
file_print(c, "\n");
|
||||
free(buf);
|
||||
free(buf);
|
||||
}
|
||||
} else {
|
||||
bufname = NULL;
|
||||
if (args_has(args, 'b'))
|
||||
|
Reference in New Issue
Block a user