From: Kirill A. Korinsky Subject: tmux: add utf8 terminal-features To: nicm@openbsd.org Cc: OpenBSD tech Date: Sun, 30 Aug 2026 23:08:12 +0200 Nicholas, as discussed / suggested in https://github.com/tmux/tmux/issues/5546 I had tried to implement utf8 in terminal-features which seems quite trivial. Ok? Index: tmux.1 =================================================================== RCS file: /home/cvs/src/usr.bin/tmux/tmux.1,v diff -u -p -r1.1159 tmux.1 --- tmux.1 25 Aug 2026 08:37:08 -0000 1.1159 +++ tmux.1 30 Aug 2026 15:03:51 -0000 @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 25 2026 $ +.Dd $Mdocdate: August 30 2026 $ .Dt TMUX 1 .Os .Sh NAME @@ -5111,6 +5111,8 @@ Supports title setting. .It usstyle Allows underscore style and colour to be set. +.It utf8 +Supports UTF\-8 output. .El .It Ic terminal\-overrides[] Ar string Allow terminal descriptions read using Index: tty-features.c =================================================================== RCS file: /home/cvs/src/usr.bin/tmux/tty-features.c,v diff -u -p -r1.42 tty-features.c --- tty-features.c 17 Aug 2026 14:47:41 -0000 1.42 +++ tty-features.c 30 Aug 2026 15:06:47 -0000 @@ -358,6 +358,13 @@ static const struct tty_feature tty_feat 0 }; +/* Terminal supports UTF-8. */ +static const struct tty_feature tty_feature_utf8 = { + "utf8", + NULL, + 0 +}; + /* Available terminal features. */ static const struct tty_feature *const tty_features[] = { &tty_feature_256, @@ -380,7 +387,8 @@ static const struct tty_feature *const t &tty_feature_strikethrough, &tty_feature_sync, &tty_feature_title, - &tty_feature_usstyle + &tty_feature_usstyle, + &tty_feature_utf8 }; /* Parse features for client. */ @@ -476,7 +484,8 @@ tty_feature_present(struct tty_term *ter * We don't just have the feature flag set. Check if the capabilities * 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); if (tf->flags != 0 && (term->flags & tf->flags) != tf->flags) return (0); @@ -524,6 +533,8 @@ tty_apply_features(struct tty_term *term } } term->flags |= tf->flags; + if (tf == &tty_feature_utf8) + c->flags |= CLIENT_UTF8; } if ((term->applied_features|feat) == term->applied_features) return (0); -- wbr, Kirill