-
Notifications
You must be signed in to change notification settings - Fork 392
completions: invoke "cd" as "builtin cd" #528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hm, I don't think I've heard of I've resisted changes like this, because one could make the same argument for pretty much any command out there leading to prefixing everything which would be annoying. In some cases would not be the right thing to do either, because there might be very real reasons for why something is aliased and having bash-completion use it is desirable. If there is a case why we'd like to do this for |
For some simple aliases, maybe you can search with I also wrote my own, being inspired by some blog article (it is about ten years ago, so I don't remember the page. Anyway it was written in Japanese). Also, I have received in my project a report on the problem caused by alias/function
There seem to be also discussions on
I think that is because these aliases and functions usually preserve the visible behavior of
builtin
I think
I don't think these interactive features (history recording, automatic corrections/expansions, etc.) are wanted for internal completions by users.
OK, I don't have particular preferences on them so will make them |
That's right. But with this I was trying to refer to blanket |
Anyway, thank you for the references, I'm sold on it now :) Let's have a look after #527 as you said. |
e5b5937
to
cac9293
Compare
I have updated to use |
cac9293
to
b7c68e1
Compare
Thanks! |
In searching the uses of
cd
command in completions, I found thatcd
is directly called instead of throughbuiltin cd
. The builtincd
is one of the commands that users define an alias or a function (to save the visited directory, etc.). I suggest prefixing them withbuiltin
keyword.I searched for the policy of
bash-completion
on this kind of treatment and found inCONTRIBUTING.md
the following item:So I think we should also apply this rule to
cd
builtin. (By the way, I found that so far no builtin commands have been prefixed bybuiltin
in any completions, socd
is the first one).I have also added a rule to
test/runLint
. There are a few false positives, and manycd
in test codes. If we should also prefixcd
in test codes, please let me know. Then, I will add them.