Merge branch 'master' into floating_panes_staging

This commit is contained in:
Nicholas Marriott
2026-05-21 08:29:14 +01:00
3 changed files with 28 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
CHANGES FROM 3.6a TO 3.6b
* Remove images from the correct list when they are removed while in the
alternate screen (reported by xlabai at tencent dot com).
CHANGES FROM 3.6 TO 3.6a CHANGES FROM 3.6 TO 3.6a
* Fix a buffer overread and an infinite loop in format processing (reported by * Fix a buffer overread and an infinite loop in format processing (reported by

1
tmux.h
View File

@@ -1699,6 +1699,7 @@ struct tty {
#define TTY_WINSIZEQUERY 0x1000 #define TTY_WINSIZEQUERY 0x1000
#define TTY_WAITFG 0x2000 #define TTY_WAITFG 0x2000
#define TTY_WAITBG 0x4000 #define TTY_WAITBG 0x4000
#define TTY_BRACKETPASTE 0x8000
#define TTY_ALL_REQUEST_FLAGS \ #define TTY_ALL_REQUEST_FLAGS \
(TTY_HAVEDA|TTY_HAVEDA2|TTY_HAVEXDA) (TTY_HAVEDA|TTY_HAVEDA2|TTY_HAVEXDA)
int flags; int flags;

View File

@@ -605,6 +605,17 @@ tty_keys_find1(struct tty_key *tk, const char *buf, size_t len, size_t *size)
return (tty_keys_find1(tk, buf, len, size)); return (tty_keys_find1(tk, buf, len, size));
} }
static int
tty_keys_partial_paste_end(const char *buf, size_t len)
{
static const char paste_end[] = "\033[201~";
size_t paste_end_len = (sizeof paste_end) - 1;
if (len == 0 || len >= paste_end_len)
return (0);
return (memcmp(buf, paste_end, len) == 0);
}
/* Look up part of the next key. */ /* Look up part of the next key. */
static int static int
tty_keys_next1(struct tty *tty, const char *buf, size_t len, key_code *key, tty_keys_next1(struct tty *tty, const char *buf, size_t len, key_code *key,
@@ -630,6 +641,10 @@ tty_keys_next1(struct tty *tty, const char *buf, size_t len, key_code *key,
if (tk->next != NULL && !expired) if (tk->next != NULL && !expired)
return (1); return (1);
*key = tk->key; *key = tk->key;
if ((*key & KEYC_MASK_KEY) == KEYC_PASTE_START)
tty->flags |= TTY_BRACKETPASTE;
else if ((*key & KEYC_MASK_KEY) == KEYC_PASTE_END)
tty->flags &= ~TTY_BRACKETPASTE;
return (0); return (0);
} }
@@ -955,10 +970,16 @@ partial_key:
delay = options_get_number(global_options, "escape-time"); delay = options_get_number(global_options, "escape-time");
if (delay == 0) if (delay == 0)
delay = 1; delay = 1;
if ((tty->flags & TTY_BRACKETPASTE) &&
tty_keys_partial_paste_end(buf, len)) {
log_debug("%s: increasing delay (partial paste end)", c->name);
if (delay < 500)
delay = 500;
}
if ((tty->flags & (TTY_WAITFG|TTY_WAITBG) || if ((tty->flags & (TTY_WAITFG|TTY_WAITBG) ||
(tty->flags & TTY_ALL_REQUEST_FLAGS) != TTY_ALL_REQUEST_FLAGS) || (tty->flags & TTY_ALL_REQUEST_FLAGS) != TTY_ALL_REQUEST_FLAGS) ||
!TAILQ_EMPTY(&c->input_requests)) { !TAILQ_EMPTY(&c->input_requests)) {
log_debug("%s: increasing delay for active query", c->name); log_debug("%s: increasing delay (active query)", c->name);
if (delay < 500) if (delay < 500)
delay = 500; delay = 500;
} }