From: nicm Date: Mon, 17 Apr 2023 18:22:24 +0000 (+0000) Subject: Ignore the user keys range when checking if a key is Unicode. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=884b6cd248647c7336589ae38690833ffd8b337b;p=openbsd Ignore the user keys range when checking if a key is Unicode. --- diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index 609d6833562..d562ea4dd9d 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.237 2023/01/20 21:36:00 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.238 2023/04/17 18:22:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1471,8 +1471,6 @@ process_key: return (0); append_key: - if (key <= 0x1f || (key >= KEYC_BASE && key < KEYC_BASE_END)) - return (0); if (key <= 0x7f) utf8_set(&tmp, key); else if (KEYC_IS_UNICODE(key)) diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index f750737383c..3fe6ff76176 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.1195 2023/03/27 08:47:57 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.1196 2023/04/17 18:22:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -157,7 +157,9 @@ struct winlink; #define KEYC_IS_UNICODE(key) \ (((key) & KEYC_MASK_KEY) > 0x7f && \ (((key) & KEYC_MASK_KEY) < KEYC_BASE || \ - ((key) & KEYC_MASK_KEY) >= KEYC_BASE_END)) + ((key) & KEYC_MASK_KEY) >= KEYC_BASE_END) && \ + (((key) & KEYC_MASK_KEY) < KEYC_USER || \ + ((key) & KEYC_MASK_KEY) >= KEYC_USER + KEYC_NUSER)) /* Multiple click timeout. */ #define KEYC_CLICK_TIMEOUT 300