Implicitly use $PWD in $CDPATH in completions and highlighting

We already do for the actual cd-ing itself.

Missed in #4484.

Fixes #8161.
This commit is contained in:
Fabian Homborg
2021-07-23 17:21:12 +02:00
parent c35ffc58fc
commit 859edc9c2c
3 changed files with 10 additions and 3 deletions

View File

@@ -163,6 +163,11 @@ mkdir -p cdpath-dir/nonexistent
mkdir -p cdpath-dir/file
set CDPATH $PWD/cdpath-dir $old_cdpath
# See that the completions also check the current directory
complete -C'cd ' | string match -q cdpath-dir/
and echo cdpath-dir is in
# CHECK: cdpath-dir is in
# A different directory with the same name that is first in $CDPATH works.
cd bad-perms
cd $old_path