| Summary: | bash-completion completely hosed | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Tom Horsley <horsley1953> |
| Component: | bash-completion | Assignee: | Ville Skyttä <ville.skytta> |
| Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 16 | CC: | sheltren, ville.skytta |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-11-13 09:25:39 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Tom Horsley
2011-11-12 21:46:01 UTC
I can't reproduce. Please do a "set -x" in a terminal, then invoke the "cd /zoo<TAB>", capture the output in a file and attach it here. Also, is the behavior always the same no matter which dir you're in when invoking the completion? It seems to work fine if I comment out these definitions in my .bashrc
file:
function _pwd () {
echo $PWD/
}
function _cd () {
'cd' "$@" > /dev/null
_pwd
}
alias cd=_cd
(I like the cd command to tell me the full path name of where I just
wound up, very handy for current directory tracking in an emacs shell).
With those defined, this is what set -x shows:
zooty> set -x
zooty> cd /zoo+ cd cd /zoo cd
bash: cd: cd: Not a directory
+ _pwd
+ echo /home/tom/
/home/tom/
Without those .bashrc defs, a humoungous set of shell gibberish is printed,
but /zoo does, in the end, get expanded to /zooty/
The function bash-completion uses for completing the cd command is also called _cd, and your bashrc definition overrides it with an incompatible one.
There has been some talk upstream to introduce a "namespace" for everything bash-completion uses/defines to make clashes like this less likely to happen (e.g. prefix all of its functions with _bashcomp_), but it is not clear when that might be implemented if at all.
I suggest renaming your _cd function so something else that doesn't clash with bash-completion. By the way I believe your bashrc setup could be simplified to something like this, no need for aliases or other functions for this purpose:
cd() { builtin cd "$@" > /dev/null ; echo $PWD/ ; }
|