mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 07:45:35 +00:00
Allow copy mode to work for readonly clients, except for copy commands,
from Dane Jensen.
This commit is contained in:
@@ -39,7 +39,8 @@ const struct cmd_entry cmd_send_keys_entry = {
|
||||
|
||||
.target = { 't', CMD_FIND_PANE, 0 },
|
||||
|
||||
.flags = CMD_AFTERHOOK|CMD_CLIENT_CFLAG|CMD_CLIENT_CANFAIL,
|
||||
.flags = CMD_AFTERHOOK|CMD_CLIENT_CFLAG|CMD_CLIENT_CANFAIL|
|
||||
CMD_READONLY,
|
||||
.exec = cmd_send_keys_exec
|
||||
};
|
||||
|
||||
@@ -167,6 +168,11 @@ cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item)
|
||||
u_int count = args_count(args);
|
||||
char *cause = NULL;
|
||||
|
||||
if (tc->flags & CLIENT_READONLY && !args_has(args, 'X')) {
|
||||
cmdq_error(item, "client is read-only");
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
|
||||
if (args_has(args, 'N')) {
|
||||
np = args_strtonum_and_expand(args, 'N', 1, UINT_MAX, item,
|
||||
&cause);
|
||||
|
||||
Reference in New Issue
Block a user