mirror of
https://github.com/tmux/tmux.git
synced 2026-08-23 23:21:36 +00:00
Ignore Ms if it is invalid (for example no %p1) and report in client
mode, GitHub issue 5460.
This commit is contained in:
3
tmux.h
3
tmux.h
@@ -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>
|
||||
@@ -1697,6 +1697,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;
|
||||
|
||||
23
tty-term.c
23
tty-term.c
@@ -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>
|
||||
@@ -28,6 +28,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);
|
||||
|
||||
@@ -516,6 +517,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 *
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user