mirror of
https://github.com/tmux/tmux.git
synced 2026-10-16 16:44:30 +00:00
Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'
* refs/remotes/tmux-openbsd/master:
Memory leak fixes from someone in GitHub issues 5739, 5744, 5745, 5746.
Add -f to switch-mode to read choices from a file, GitHub issue 5738.
Set session for {current} target, GitHub issue 5742.
Do not discard control state before a control client creates it, GitHub issue 5740 from Andre Popp.
A few additional readonly checks, GitHub issue 5736 from gmkbenjamin at hotmail dot com.
This commit is contained in:
11
cmd-queue.c
11
cmd-queue.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: cmd-queue.c,v 1.124 2026/09/22 06:46:50 nicm Exp $ */
|
||||
/* $OpenBSD: cmd-queue.c,v 1.125 2026/10/15 07:25:07 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -594,6 +594,15 @@ cmdq_fire_command(struct cmdq_item *item)
|
||||
flags = !!(state->flags & CMDQ_STATE_CONTROL);
|
||||
cmdq_guard(item, "begin", flags);
|
||||
|
||||
if (flags &&
|
||||
saved != NULL &&
|
||||
(saved->flags & CLIENT_READONLY) &&
|
||||
(~entry->flags & CMD_READONLY)) {
|
||||
cmdq_error(item, "client is read-only");
|
||||
retval = CMD_RETURN_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (item->client == NULL)
|
||||
item->client = cmd_find_client(item, NULL, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user