Comments (5)
@akinomyoga Thank you very much for the feedback. This is the magic of open source.
You are right, I can remove the following lines, and CDPATH
works as expected.
complete -d cd
complete -o nospace -F _cd cd
I still have a configuration issue because I want to restrict the cd
autocompletion to only directories, but now it also shows environment variables and Bash functions. Anyway, that's not a bash-completion bug.
from bash-completion.
Some extra information that could be relevant. This is the output when is not working:
$ complete | grep " cd$" complete -d cd
I suspect that that is caused by a different framework because bash-completion
doesn't include such a setting:
from bash-completion.
This line in your config is causing the issue.
from bash-completion.
I want to restrict the
cd
autocompletion to only directories, but now it also shows environment variables
That is related to this setting. The Bash feature cdable_vars
allows you to specify a variable name to cd
so that cd
reads the content of the variable to pick the path to a directory. If you do not specify variable names to cd
, you can remove that setting.
and Bash functions.
Hmm, I'm not sure about this one. It doesn't complete the names of shell functions in my environment. Or maybe do you mean "the special variables of Bash" by "Bash functions"?
from bash-completion.
@akinomyoga This is the output I was getting:
![Screenshot 2024-06-10 at 13 53 30](https://private-user-images.githubusercontent.com/392222/338172233-4b3e699c-f967-4a7e-9e88-0eb976102d31.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4MTgxMzAsIm5iZiI6MTcxODgxNzgzMCwicGF0aCI6Ii8zOTIyMjIvMzM4MTcyMjMzLTRiM2U2OTljLWY5NjctNGE3ZS05ZTg4LTBlYjk3NjEwMmQzMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxOVQxNzIzNTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MTFlZjNhZGUwMjMzMTMwOTc4MTk4NDQwMzVlMGY2MWFmNjAxY2U5OTBlNDdhNThhNjU0NmFhYjQ2NWEzZDYwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.9nckA8nMwfIs6Cg1AQowGAVLCuABaTy81ndYtPMmli8)
But you are right again, shopt -s cdable_vars
was interfering here.
Thank you very much for your help! I've removed a few lines of code arturoherrero/dotfiles@6e436f6
achieving the same results 🙌
from bash-completion.
Related Issues (20)
- _comp_compgen_available_interfaces returns trailing colons HOT 6
- Available interface completion strips too much
- _split_longopt rename is breaking downstream (3rd party) completion scripts HOT 5
- scp remote path completion no longer working since 2.12 HOT 4
- Readline colors command completions as files (red blinking text) HOT 3
- Bash completions causing syntax error near unexpected token `(' HOT 7
- Nit HOT 3
- xargs HOT 1
- Hard to find where to report bugs HOT 2
- Latest CHANGELOG.md starts at `## 2.11...` and earlier HOT 2
- Redirection moved to the front wrongly affects completions HOT 2
- Gentoo update to 2.14 fails due to QA notice HOT 3
- tar file completion not working as expected under various option combinations HOT 2
- Enable .java Filename Completion for java Command HOT 2
- GCC tests fail on non-x86 platforms HOT 1
- 000_bash_completion_compat.bash sourced last in some locales HOT 1
- bash: _comp_initialize: command not found HOT 2
- [Regression] make autocompletion skips install HOT 3
- Native bash-completion 2 loader using complete -D HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bash-completion.