diff --git a/NEWS b/NEWS index 7432ecc8c..19987e684 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,11 @@ For full details, see the git log at: https://github.com/ksh93/ksh Any uppercase BUG_* names are modernish shell bug IDs. +2021-04-16: + +- Fixed a bug in emacs mode: after using tab completion to complete the name + of a directory, it was not possible to type numbers after the slash. + 2021-04-15: - Fixed an optimization bug that caused the <>; redirection operator to fail diff --git a/src/cmd/ksh93/edit/emacs.c b/src/cmd/ksh93/edit/emacs.c index 44ef89e7c..8ffe0e121 100644 --- a/src/cmd/ksh93/edit/emacs.c +++ b/src/cmd/ksh93/edit/emacs.c @@ -1008,8 +1008,14 @@ static int escape(register Emacs_t* ep,register genchar *out,int count) case '=': /* escape = - list all matching file names */ ep->mark = cur; if(cur<1) + { beep(); - else if(ed_expand(ep->ed,(char*)out,&cur,&eol,i,count) < 0) + return(-1); + } + ch = i; + if(i=='\\' && out[cur-1]=='/') + i = '='; + if(ed_expand(ep->ed,(char*)out,&cur,&eol,ch,count) < 0) { if(ep->ed->e_tabcount==1) { @@ -1022,7 +1028,7 @@ static int escape(register Emacs_t* ep,register genchar *out,int count) else if(i=='=' || (i=='\\' && out[cur-1]=='/')) { draw(ep,REFRESH); - if(count>0) + if(count>0 || i=='\\') ep->ed->e_tabcount=0; else { diff --git a/src/cmd/ksh93/include/version.h b/src/cmd/ksh93/include/version.h index abbc3c7a3..14bb9d529 100644 --- a/src/cmd/ksh93/include/version.h +++ b/src/cmd/ksh93/include/version.h @@ -20,7 +20,7 @@ #define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */ #define SH_RELEASE_SVER "1.0.0-alpha" /* semantic version number: https://semver.org */ -#define SH_RELEASE_DATE "2021-04-15" /* must be in this format for $((.sh.version)) */ +#define SH_RELEASE_DATE "2021-04-16" /* must be in this format for $((.sh.version)) */ #define SH_RELEASE_CPYR "(c) 2020-2021 Contributors to ksh " SH_RELEASE_FORK /* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */ diff --git a/src/cmd/ksh93/tests/pty.sh b/src/cmd/ksh93/tests/pty.sh index ba62b83fc..042630086 100755 --- a/src/cmd/ksh93/tests/pty.sh +++ b/src/cmd/ksh93/tests/pty.sh @@ -786,5 +786,16 @@ r ^:test-2: echo asdf\r\n$ r ^asdf\r\n$ ! +# err_exit # +((SHOPT_ESH)) && mkdir -p emacstest/123abc && VISUAL=emacs tst $LINENO <<"!" +L autocomplete stops numeric input +# https://github.com/ksh93/ksh/issues/198 + +d 15 +p :test-1: +w cd emacste\t123abc +r ^:test-1: cd emacstest/123abc\r\n$ +! + # ====== exit $((Errors<125?Errors:125))