diff --git a/NEWS b/NEWS index 6e718db0c..b0ee23497 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ Any uppercase BUG_* names are modernish shell bug IDs. 2022-02-11: +- On the interactive shell, tab/esc completion is no longer disabled as a side + effect of turning off pathname expansion with 'set -f' or 'set -o noglob'. + - Fixed a bug in which a >&- or <&- redirection could persist past a subshell in certain corner cases involving 'exec' or 'redirect'. diff --git a/src/cmd/ksh93/sh/expand.c b/src/cmd/ksh93/sh/expand.c index 6576aa7c0..fbb58976c 100644 --- a/src/cmd/ksh93/sh/expand.c +++ b/src/cmd/ksh93/sh/expand.c @@ -284,7 +284,7 @@ again: for(; ap; ap=apin) { apin = ap->argchn.ap; - if(!sh_isoption(SH_NOGLOB)) + if(!sh_isoption(SH_NOGLOB) || sh_isstate(SH_COMPLETE) || sh_isstate(SH_FCOMPLETE)) brace=path_expand(ap->argval,arghead); else { diff --git a/src/cmd/ksh93/sh/macro.c b/src/cmd/ksh93/sh/macro.c index 1875bf5a2..744269203 100644 --- a/src/cmd/ksh93/sh/macro.c +++ b/src/cmd/ksh93/sh/macro.c @@ -212,7 +212,7 @@ int sh_macexpand(register struct argnod *argp, struct argnod **arghead,int flag) mp->arith = ((flag&ARG_ARITH)!=0); mp->split = !(flag&ARG_ASSIGN); mp->assign = !mp->split; - mp->pattern = mp->split && !(flag&ARG_NOGLOB) && !sh_isoption(SH_NOGLOB); + mp->pattern = mp->split && !(flag&ARG_NOGLOB) && (!sh_isoption(SH_NOGLOB) || sh_isstate(SH_COMPLETE) || sh_isstate(SH_FCOMPLETE)); mp->arrayok = mp->arith || (flag&ARG_ARRAYOK); str = argp->argval; fcsopen(str); diff --git a/src/cmd/ksh93/tests/pty.sh b/src/cmd/ksh93/tests/pty.sh index 211d1c836..06f316bb1 100755 --- a/src/cmd/ksh93/tests/pty.sh +++ b/src/cmd/ksh93/tests/pty.sh @@ -952,13 +952,16 @@ w exit touch "$tmp/foo bar" ((SHOPT_VSH || SHOPT_ESH)) && tst $LINENO <