bash-completion: use modern lazy-load directory #132
bash-completion: use modern lazy-load directory #132
Conversation
I'm not sure how to handle zsh completions. As I'm not a zsh user, I cannot speak authoritatively, but I don't know of a comparable user directory (the zsh |
As a side note: for system packaging, I'm using the following:
I've traced the imports and executed the autocomplete functions by hand for each shell, since I need to install all of them and to I would be interested to see a way to install these via dephell itself, but I'm not sure how it would be done -- furthermore, it would need to know how to select between the user directory and the system directory. |
I discovered this topic. You have to modify |
We had here hack for Mac OS. I'm afraid that these changes will not work on it. Maybe, we can check |
macOS should be fine as long as the user has installed It is possible to check which version is installed using |
2e20f13
to
e73014d
Compare
I'm not Mac OS user. And I don't want to force them to do any additional manipulations to make DepHell work. It would be cool to support everything that we can. |
e73014d
to
2d88ca8
Compare
Okay -- let's use the modern bash-completion directory, but on macOS also add it to the bashrc just in case. This should work fine regardless of bash-completion version and even work if there is no bash-completion at all. On linux bash-completion is pretty standard and up to date -- and most distros will even install it automatically for you. |
Perfect, thank you :) I'll check and merge it tomorrow. |
It writes |
Oh, I see, the path must be |
The legacy bash_completion.d directory requires every script be sourced at shell startup, which is slow. Since bash-completion 2.x (released in 2012), completions are loaded on-demand -- a minimal completion stub is defined as the default command completer, which will search for a script in the completionsdir named the same as the command, and source this script in order to update the command completion. Make use of this lazy-loaded completion. This entails: - moving the installation location - getting rid of the legacy modification of .bashrc which is no longer needed
2d88ca8
to
a813d7f
Compare
Thank you :) |
The legacy bash_completion.d directory requires every script be sourced at shell startup, which is slow. Since bash-completion 2.x (released in 2012), completions are loaded on-demand -- a minimal completion stub is defined as the default command completer, which will search for a script in the completionsdir named the same as the command, and source this script in order to update the command completion.
Make use of this lazy-loaded completion. This entails: