Skip to content

Commit 925defb

Browse files
committed
fix(_filedir): always set compopt -o filenames to quote special chars
This fixes test_15d in test/t/unit/test_unit_filedir.py.
1 parent f551092 commit 925defb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

bash_completion

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,9 +1170,8 @@ _comp_compgen_filedir()
11701170
compopt -o nospace 2>/dev/null
11711171
fi
11721172
done
1173-
else
1174-
compopt -o filenames 2>/dev/null
11751173
fi
1174+
compopt -o filenames 2>/dev/null
11761175
fi
11771176

11781177
# Note: bash < 4.4 has a bug that all the elements are connected with

test/t/unit/test_unit_filedir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def functions(self, request, bash):
3737
)
3838
assert_bash_exec(
3939
bash,
40-
"_fcd() { local cur=$(_get_cword); unset -v COMPREPLY; _comp_compgen -C _filedir filedir -d; };"
40+
"_fcd() { local cur=$(_get_cword); unset -v COMPREPLY; _comp_compgen -C _filedir filedir -df; };"
4141
"complete -F _fcd fcd",
4242
)
4343

0 commit comments

Comments
 (0)