Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'

* refs/remotes/tmux-openbsd/master:
  Ignore Ms if it is invalid (for example no %p1) and report in client mode, GitHub issue 5460.
This commit is contained in:
tmux update bot
2026-08-05 11:31:10 +00:00
3 changed files with 35 additions and 7 deletions

3
tmux.h
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tmux.h,v 1.1421 2026/08/03 20:18:20 nicm Exp $ */
/* $OpenBSD: tmux.h,v 1.1422 2026/08/05 08:54:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1731,6 +1731,7 @@ struct tty_term {
#define TERM_RGBCOLOURS 0x10
#define TERM_VT100LIKE 0x20
#define TERM_SIXEL 0x40
#define TERM_INVALIDMS 0x80
int flags;
LIST_ENTRY(tty_term) entry;

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tty-term.c,v 1.106 2026/06/13 09:17:29 nicm Exp $ */
/* $OpenBSD: tty-term.c,v 1.107 2026/08/05 08:54:56 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -31,6 +31,7 @@
#include "tmux.h"
static char *tty_term_strip(const char *);
static void tty_term_validate(struct tty_term *);
struct tty_terms tty_terms = LIST_HEAD_INITIALIZER(tty_terms);
@@ -519,6 +520,26 @@ tty_term_apply_overrides(struct tty_term *term)
acs = "a#j+k+l+m+n+o-p-q-r-s-t+u+v+w+x|y<z>~.";
for (; acs[0] != '\0' && acs[1] != '\0'; acs += 2)
term->acs[(u_char) acs[0]][0] = acs[1];
tty_term_validate(term);
}
static void
tty_term_validate(struct tty_term *term)
{
struct tty_code *code = &term->codes[TTYC_MS];
if (code->type != TTYCODE_STRING)
return;
if (*tty_term_string_ss(term, TTYC_MS, "c", "?") != '\0') {
term->flags &= ~TERM_INVALIDMS;
return;
}
log_debug("removing invalid Ms capability");
term->flags |= TERM_INVALIDMS;
free(code->value.string);
code->type = TTYCODE_NONE;
}
struct tty_term *

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: window-client.c,v 1.47 2026/07/14 17:17:18 nicm Exp $ */
/* $OpenBSD: window-client.c,v 1.48 2026/08/05 08:54:56 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -113,14 +113,16 @@ static const char *window_client_info_lines[] = {
"#{?#{I/c:kmous},,#[align=right]unavailable: [kmous] missing}",
"#[fg=themelightgrey]set-clipboard #[#{E:tree-mode-border-style},acs]x#[default] "
"#{?#{!=:#{set-clipboard},off},#{?#{I/f:clipboard},,"
"#{?#{!=:#{set-clipboard},off},#{?#{I/c:Ms},,"
"#[fg=themered]}#{set-clipboard},#[fg=themelightgrey]off} "
"#{?#{I/f:clipboard},,#[align=right]unavailable: [Ms] missing}",
"#{?#{I/c:Ms},,#[align=right]unavailable: [Ms] "
"#{?clipboard_invalid,invalid,missing}}",
"#[fg=themelightgrey]get-clipboard #[#{E:tree-mode-border-style},acs]x#[default] "
"#{?#{!=:#{get-clipboard},off},#{?#{I/f:clipboard},,"
"#{?#{!=:#{get-clipboard},off},#{?#{I/c:Ms},,"
"#[fg=themered]}#{get-clipboard},#[fg=themelightgrey]off} "
"#{?#{I/f:clipboard},,#[align=right]unavailable: [Ms] missing}",
"#{?#{I/c:Ms},,#[align=right]unavailable: [Ms] "
"#{?clipboard_invalid,invalid,missing}}",
"#[fg=themelightgrey]focus-events #[#{E:tree-mode-border-style},acs]x#[default] "
"#{?focus-events,#{?#{I/f:focus},,#[fg=themered]}on,#[fg=themelightgrey]off} "
@@ -273,6 +275,10 @@ window_client_draw_info(__unused void *modedata, void *itemdata,
char *expanded;
ft = format_create_defaults(NULL, c, NULL, NULL, NULL);
if (c->tty.term->flags & TERM_INVALIDMS)
format_add(ft, "clipboard_invalid", "1");
else
format_add(ft, "clipboard_invalid", "0");
screen_write_cursormove(ctx, cx, cy, 0);
for (i = 0; i < nitems(window_client_info_lines); i++) {