tmux: add utf8 terminal-features

OK: nicm@
This commit is contained in:
kirill
2026-08-31 12:41:03 +00:00
committed by tmux update bot
parent 8b3834c34f
commit f2bfd611e2
3 changed files with 24 additions and 7 deletions

6
tmux.1
View File

@@ -1,4 +1,4 @@
.\" $OpenBSD: tmux.1,v 1.1159 2026/08/25 08:37:08 nicm Exp $ .\" $OpenBSD: tmux.1,v 1.1160 2026/08/31 12:41:03 kirill Exp $
.\" .\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\" .\"
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: August 25 2026 $ .Dd $Mdocdate: August 31 2026 $
.Dt TMUX 1 .Dt TMUX 1
.Os .Os
.Sh NAME .Sh NAME
@@ -5111,6 +5111,8 @@ Supports
title setting. title setting.
.It usstyle .It usstyle
Allows underscore style and colour to be set. Allows underscore style and colour to be set.
.It utf8
Supports UTF\-8 output.
.El .El
.It Ic terminal\-overrides[] Ar string .It Ic terminal\-overrides[] Ar string
Allow terminal descriptions read using Allow terminal descriptions read using

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tty-features.c,v 1.42 2026/08/17 14:47:41 nicm Exp $ */ /* $OpenBSD: tty-features.c,v 1.43 2026/08/31 12:41:03 kirill Exp $ */
/* /*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -358,6 +358,13 @@ static const struct tty_feature tty_feature_progressbar = {
0 0
}; };
/* Terminal supports UTF-8. */
static const struct tty_feature tty_feature_utf8 = {
"utf8",
NULL,
0
};
/* Available terminal features. */ /* Available terminal features. */
static const struct tty_feature *const tty_features[] = { static const struct tty_feature *const tty_features[] = {
&tty_feature_256, &tty_feature_256,
@@ -380,7 +387,8 @@ static const struct tty_feature *const tty_features[] = {
&tty_feature_strikethrough, &tty_feature_strikethrough,
&tty_feature_sync, &tty_feature_sync,
&tty_feature_title, &tty_feature_title,
&tty_feature_usstyle &tty_feature_usstyle,
&tty_feature_utf8
}; };
/* Parse features for client. */ /* Parse features for client. */
@@ -463,6 +471,9 @@ tty_feature_present(struct tty_term *term, const char *name)
u_int i; u_int i;
char *copy; char *copy;
if (strcmp(name, "utf8") == 0)
return ((term->tty->client->flags & CLIENT_UTF8) != 0);
for (i = 0; i < nitems(tty_features); i++) { for (i = 0; i < nitems(tty_features); i++) {
tf = tty_features[i]; tf = tty_features[i];
if (strcmp(tf->name, name) == 0) { if (strcmp(tf->name, name) == 0) {
@@ -476,7 +487,8 @@ tty_feature_present(struct tty_term *term, const char *name)
* We don't just have the feature flag set. Check if the capabilities * We don't just have the feature flag set. Check if the capabilities
* supported by the client are actual set instead. * supported by the client are actual set instead.
*/ */
if (tf == NULL || strcmp(name, "ignorefkeys") == 0) if (tf == NULL || tf->capabilities == NULL ||
strcmp(name, "ignorefkeys") == 0)
return (0); return (0);
if (tf->flags != 0 && (term->flags & tf->flags) != tf->flags) if (tf->flags != 0 && (term->flags & tf->flags) != tf->flags)
return (0); return (0);
@@ -524,6 +536,8 @@ tty_apply_features(struct tty_term *term)
} }
} }
term->flags |= tf->flags; term->flags |= tf->flags;
if (tf == &tty_feature_utf8)
c->flags |= CLIENT_UTF8;
} }
if ((term->applied_features|feat) == term->applied_features) if ((term->applied_features|feat) == term->applied_features)
return (0); return (0);

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: window-client.c,v 1.48 2026/08/05 08:54:56 nicm Exp $ */ /* $OpenBSD: window-client.c,v 1.49 2026/08/31 12:41:03 kirill Exp $ */
/* /*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -102,7 +102,8 @@ static const char *window_client_info_lines[] = {
WINDOW_CLIENT_FEATURE(sync) " " WINDOW_CLIENT_FEATURE(sync) " "
WINDOW_CLIENT_FEATURE(title), WINDOW_CLIENT_FEATURE(title),
" #[#{E:tree-mode-border-style},acs]x#[default] " " #[#{E:tree-mode-border-style},acs]x#[default] "
WINDOW_CLIENT_FEATURE(usstyle), WINDOW_CLIENT_FEATURE(usstyle) " "
WINDOW_CLIENT_FEATURE(utf8),
"#[#{E:tree-mode-border-style},acs]qqqqqqqqqqqqqqn#{R:q,#{window_width}}#[default]", "#[#{E:tree-mode-border-style},acs]qqqqqqqqqqqqqqn#{R:q,#{window_width}}#[default]",
"#[fg=themelightgrey]prefix #[#{E:tree-mode-border-style},acs]x#[default] " "#[fg=themelightgrey]prefix #[#{E:tree-mode-border-style},acs]x#[default] "