-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
bash autocompletion in nix shell (nix command) #4453
Comments
Another way to make this work is by using This is similar to what the |
Basically what I'm suggesting is to treat "environment variables" as a serious deployment target, where a package can tell Nix exactly what to do, or rely on the default ( Something like passthru.useViaEnvironment = {
PATH = "${self.outPath}/bin:${commonlyUsedRuntimeDep}/bin";
XDG_DATA_DIRS = "${self.outPath}/share/foo";
shellHook = "echo To initialize the foo package config, run foo init";
} just to illustrate the concept. I'm assuming NixOS/nixpkgs#119942 for simplicity on the Nix side of this interface. The self-referential nature of this feature can be worked around with placeholders, but I would prefer to exploit the existing language instead. How the exactly the environment variables should be merged isn't obvious. Nix could hardcode some of them. Nixpkgs doesn't know how to do it yet either NixOS/nixpkgs#122244. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/confusion-about-bash-completions-flake-related/14579/16 |
Is this similar to nix-community/lorri#61 ? |
@SuperSandro2000 yes, it's all necessary to make completions work beyond simple nix-shell + stdenv (NixOS/nixpkgs#103501) |
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/interactive-bash-with-nix-develop-flake/15486/4 |
Is your feature request related to a problem? Please describe.
It's frustrating when autocompletion doesn't work in a shell.
Describe the solution you'd like
Simple option: add entries to
XDG_DATA_DIRS
.Complicated option: make
nix shell
use stdenv, which can take care of this logic, at the cost of a Nixpkgs dependency.Describe alternatives you've considered
Write GUIs for everything that shouldn't have a GUI.
Additional context
Completions are available for derivation-based shells since NixOS/nixpkgs#103501
nix-shell
also needs adjustment, see #4452The text was updated successfully, but these errors were encountered: