[Bash-completion-devel] [bash-completion-Bugs][313199] Completion for the `cd` command does not expand variables.
bash-completion-bugs at alioth.debian.org
bash-completion-bugs at alioth.debian.org
Fri Jul 1 23:44:11 UTC 2011
Bugs item #313199, was changed at 2011-06-30 15:52 by Andrew Russell
You can respond by visiting:
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313199&group_id=100114
Status: Open
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: Completion for the `cd` command does not expand variables.
Distribution: --Distribution-Agnostic--
Originally reported in: None
Milestone: None
Status: None
Original bug number:
Initial Comment:
Anonymous message posted by deadhead.russell at gmail.com
Currently, bash_completion will auto complete variables for the `cd` command. However, these variables are not expanded making auto-completion not work for the remainder of the command.
Example:
Lets say I have a variable, `$variable` which is `/path/to` and I have the folder structure, `/path/to/directory/`.
cd $variable/direct<TAB>
currently does nothing. I expect it to expand the variable and complete it to:
cd /path/to/directory/
I have created a patch where variables are still auto completed. However, if only one match is returned, the matched variable is expanded and the completion continues.
----------------------------------------------------------------------
Comment By: Andrew Russell (deadhead-guest)
Date: 2011-07-01 16:44
Message:
I have modified the patch slightly such that auto-completing of variables that returns no matches does not auto-complete to the empty string.
This changes the following line:
+ if [[ "${#variables[1]}" -ne 0 ]]; then
To this new line:
+ if [[ "${#variables[1]}" -ne 0 ]] || [[ "${#variables[@]}" -eq 0 ]]; then
----------------------------------------------------------------------
You can respond by visiting:
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313199&group_id=100114
More information about the Bash-completion-devel
mailing list