File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ _comp_cmd_cd()
7272
7373 compopt -o filenames
7474 _comp_cmd_cd__compgen_cdable_vars
75- _comp_cmd_cd__compgen_cdpath
75+ _comp_compgen -ai cd cdpath
7676 _comp_compgen -a filedir -d
7777}
7878complete -F _comp_cmd_cd -o nospace cd pushd
Original file line number Diff line number Diff line change @@ -42,3 +42,12 @@ def test_cdable_vars(self, bash):
4242 bash_env .write_variable ("foo6" , "shared/default/bar" )
4343 completion = assert_complete (bash , "cd f" )
4444 assert completion == ["foo1" , "foo2" ]
45+
46+ def test_cdable_vars_2 (self , bash ):
47+ with bash_env_saved (bash ) as bash_env :
48+ bash_env .write_variable ("CDPATH" , "nonexistent" )
49+ bash_env .shopt ("cdable_vars" , True )
50+ bash_env .write_variable ("foo1" , "shared" )
51+ bash_env .write_variable ("foo2" , "shared/default" )
52+ completion = assert_complete (bash , "cd f" )
53+ assert completion == ["foo1" , "foo2" ]
You can’t perform that action at this time.
0 commit comments