diff --git a/NEWS b/NEWS index d4043c0cd..abf21453f 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,12 @@ This documents significant changes in the 1.0 branch of ksh 93u+m. For full details, see the git log at: https://github.com/ksh93/ksh/tree/1.0 Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library. +2022-08-24: + +- Fixed a bug that caused ksh in the vi editor mode to crash or produce + invalid completions if ESC = was used at the beginning of a line. Both + tab and = completions are now disabled at the start of the command line. + 2022-08-20: - Fixed a bug in command line options processing that caused short-form diff --git a/src/cmd/ksh93/edit/vi.c b/src/cmd/ksh93/edit/vi.c index 9a19cedc5..c8bc5eab6 100644 --- a/src/cmd/ksh93/edit/vi.c +++ b/src/cmd/ksh93/edit/vi.c @@ -1560,6 +1560,11 @@ static void getline(register Vi_t* vp,register int mode) } vp->ed->e_tabcount = 0; } + if(cur_virt <= 0) + { + ed_ringbell(); + break; + } /* FALLTHROUGH */ default: fallback: @@ -1581,7 +1586,6 @@ static void getline(register Vi_t* vp,register int mode) break; } refresh(vp,INPUT); - } } @@ -2540,10 +2544,10 @@ addin: /* FALLTHROUGH */ case '*': /** do file name expansion in place **/ case '\\': /** do file name completion in place **/ + case '=': /** list file name expansions **/ if( cur_virt == INVALID ) return(BAD); /* FALLTHROUGH */ - case '=': /** list file name expansions **/ save_v(vp); i = last_virt; ++last_virt; diff --git a/src/cmd/ksh93/include/version.h b/src/cmd/ksh93/include/version.h index 7adaa23f0..3d6ac882e 100644 --- a/src/cmd/ksh93/include/version.h +++ b/src/cmd/ksh93/include/version.h @@ -18,7 +18,7 @@ #define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */ #define SH_RELEASE_SVER "1.0.3-alpha" /* semantic version number: https://semver.org */ -#define SH_RELEASE_DATE "2022-08-20" /* must be in this format for $((.sh.version)) */ +#define SH_RELEASE_DATE "2022-08-24" /* must be in this format for $((.sh.version)) */ #define SH_RELEASE_CPYR "(c) 2020-2022 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/sh.1 b/src/cmd/ksh93/sh.1 index 88b70b481..fcccc4936 100644 --- a/src/cmd/ksh93/sh.1 +++ b/src/cmd/ksh93/sh.1 @@ -5581,10 +5581,10 @@ or character. .TP 10 .BI ^I " tab" -Attempts command or file name completion as described above -and returns to input mode. -If a partial completion occurs, repeating this will -behave as if +Except at the start of the line, attempts command or +file name completion as described above and returns to +input mode. If a partial completion occurs, repeating +this will behave as if .B = were entered from control mode. If no match is found or entered after