1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Do not disable completion along with pathname expansion

The -f/--noglob shell option is documented simply as: "Disables
pathname expansion." But after 'set -f' on an interactive shell,
command completion and file name completion also stop working. This
is because they internally use the pathname expansion mechanism.
But it is not documented anywhere that 'set -f' disables
completion; it's just a side effect of an implementation detail.

Though ksh has always acted like this, I think it should change
because it's not useful or expected behaviour. Other shells like
bash, yash or zsh don't act like this.

src/cmd/ksh93/sh/expand.c,
src/cmd/ksh93/sh/macro.c:
- Allow the SH_COMPLETE (command completion) or SH_FCOMPLETE
  (file name completion) state bit to override SH_NOGLOB in
  path_generate() and in sh_macexpand().
This commit is contained in:
Martijn Dekker 2022-02-11 12:02:27 +00:00
parent 4fee9d84fe
commit 56c0c24b55
4 changed files with 10 additions and 4 deletions

3
NEWS
View file

@ -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'.