diff --git a/NEWS b/NEWS index bee1a3506e74..5203146942b6 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,12 @@ This documents significant changes in the dev branch of ksh 93u+m. For full details, see the git log at: https://github.com/ksh93/ksh Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library. +2024-12-30: + +- The KEYBD trap should now be fully functional for multibyte characters + (for example, non-Latin characters in UTF-8 locales). This fixes a bug + inherited from AT&T and worked around on 2022-02-12. + 2024-12-29: - [v1.1] The emacs ^Y command now accepts a numeric parameter. For example, diff --git a/src/cmd/ksh93/edit/edit.c b/src/cmd/ksh93/edit/edit.c index cbd39ee4cfca..fab11b17c6fb 100644 --- a/src/cmd/ksh93/edit/edit.c +++ b/src/cmd/ksh93/edit/edit.c @@ -831,14 +831,11 @@ int ed_getchar(Edit_t *ep,int mode) { if(mode<=0 && -c == ep->e_intr) killpg(getpgrp(),SIGINT); - if(mode<=0 && sh.st.trap[SH_KEYTRAP] - /* workaround for : - * do not trigger KEYBD for non-ASCII in multibyte locale */ - && (!mbwide() || c > -128)) + if(mode<=0 && sh.st.trap[SH_KEYTRAP]) { ep->e_keytrap = 1; - n=1; - if((readin[0]= -c) == ESC) + n = mbconv(readin, -c); + if(n==1 && readin[0]==ESC) { while(1) { diff --git a/src/cmd/ksh93/include/version.h b/src/cmd/ksh93/include/version.h index 96af922cfbb9..81cdb9e839bf 100644 --- a/src/cmd/ksh93/include/version.h +++ b/src/cmd/ksh93/include/version.h @@ -18,7 +18,7 @@ #include #include "git.h" -#define SH_RELEASE_DATE "2024-12-29" /* must be in this format for $((.sh.version)) */ +#define SH_RELEASE_DATE "2024-12-30" /* must be in this format for $((.sh.version)) */ /* * This comment keeps SH_RELEASE_DATE a few lines away from SH_RELEASE_SVER to avoid * merge conflicts when cherry-picking dev branch commits onto a release branch. diff --git a/src/cmd/ksh93/sh.1 b/src/cmd/ksh93/sh.1 index 0b1cf3ab93e0..dc1aa0ef5876 100644 --- a/src/cmd/ksh93/sh.1 +++ b/src/cmd/ksh93/sh.1 @@ -9597,10 +9597,6 @@ Thus, a trap on .B CHLD won't be executed until the foreground job terminates. .PP -In locales that use a multibyte character set such as UTF-8, the -.B KEYBD -trap is only triggered for ASCII characters (1-127). -.PP It is a good idea to leave a space after the comma operator in arithmetic expressions to prevent the comma from being interpreted as the decimal point character in certain locales.