summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-01-28 14:01:25 +0000
committerThomas Adam <thomas@xteddy.org>2020-01-28 14:01:25 +0000
commit7eada28f965d8e3b01df6e070e3b1ce5cb1784bf (patch)
tree03e46e4a2c6b4be5af4c11d8e25beacc2b6682ba
parent60ab7144517483d4343e7a68625e376c34557b8a (diff)
parentb905c5d455b354f7210dc118f748a658f0358cd7 (diff)
Merge branch 'obsd-master'
-rw-r--r--cmd-parse.y10
-rw-r--r--resize.c16
-rw-r--r--tmux.h3
3 files changed, 21 insertions, 8 deletions
diff --git a/cmd-parse.y b/cmd-parse.y
index 41bcdaa8..2375370b 100644
--- a/cmd-parse.y
+++ b/cmd-parse.y
@@ -341,7 +341,8 @@ commands : command
struct cmd_parse_state *ps = &parse_state;
$$ = cmd_parse_new_commands();
- if (ps->scope == NULL || ps->scope->flag)
+ if ($1->name != NULL &&
+ (ps->scope == NULL || ps->scope->flag))
TAILQ_INSERT_TAIL($$, $1, entry);
else
cmd_parse_free_command($1);
@@ -360,7 +361,8 @@ commands : command
{
struct cmd_parse_state *ps = &parse_state;
- if (ps->scope == NULL || ps->scope->flag) {
+ if ($3->name != NULL &&
+ (ps->scope == NULL || ps->scope->flag)) {
$$ = $1;
TAILQ_INSERT_TAIL($$, $3, entry);
} else {
@@ -641,8 +643,6 @@ cmd_parse_build_commands(struct cmd_parse_commands *cmds,
* command list.
*/
TAILQ_FOREACH_SAFE(cmd, cmds, entry, next) {
- if (cmd->name == NULL)
- continue;
alias = cmd_get_alias(cmd->name);
if (alias == NULL)
continue;
@@ -688,8 +688,6 @@ cmd_parse_build_commands(struct cmd_parse_commands *cmds,
*/
result = cmd_list_new();
TAILQ_FOREACH(cmd, cmds, entry) {
- if (cmd->name == NULL)
- continue;
log_debug("%s: %u %s", __func__, cmd->line, cmd->name);
cmd_log_argv(cmd->argc, cmd->argv, __func__);
diff --git a/resize.c b/resize.c
index b4142a70..96d733f0 100644
--- a/resize.c
+++ b/resize.c
@@ -66,10 +66,26 @@ resize_window(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
static int
ignore_client_size(struct client *c)
{
+ struct client *loop;
+
if (c->session == NULL)
return (1);
if (c->flags & CLIENT_NOSIZEFLAGS)
return (1);
+ if (c->flags & CLIENT_READONLY) {
+ /*
+ * Ignore readonly clients if there are any attached clients
+ * that aren't readonly.
+ */
+ TAILQ_FOREACH (loop, &clients, entry) {
+ if (loop->session == NULL)
+ continue;
+ if (loop->flags & CLIENT_NOSIZEFLAGS)
+ continue;
+ if (~loop->flags & CLIENT_READONLY)
+ return (1);
+ }
+ }
if ((c->flags & CLIENT_CONTROL) && (~c->flags & CLIENT_SIZECHANGED))
return (1);
return (0);
diff --git a/tmux.h b/tmux.h
index 0248110a..bb4850b2 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1592,8 +1592,7 @@ struct client {
#define CLIENT_NOSIZEFLAGS \
(CLIENT_DEAD| \
CLIENT_SUSPENDED| \
- CLIENT_DETACHING| \
- CLIENT_READONLY)
+ CLIENT_DETACHING)
int flags;
struct key_table *keytable;