Open ChanceHarrison opened 4 weeks ago
Hi Chance! We met at NixCon, right?
I'm not totally against this feature, although I personally don't really see the value in it. Maybe we could add an environment variable with a list of loaded packages and use that to construct a prompt by e.g. adding another function to the shell templates?
We met at NixCon, right?
Yes, we did! Hello again! :wave:
I'm not totally against this feature, although I personally don't really see the value in it.
I appreciate your thoughts on the matter.
To me, I think the value really comes when juggling multiple shells. In that case, I can easily tell at a glance whether that shell has extra executables available (from nix(-)shell
invocations) beyond my standard system environment. It saves me from switching terminals, entering a command, and realizing I didn't invoke nix(-)shell
in that particular terminal.
Of lesser(?) importance, it also helps me know how many shells "deep" I am / the number of nix(-)shell
invocations. I suppose that's only of value in easily answering the question of "what will exit
do?"
Whether either of those should actually be considered of value is certainly subjective.
I suppose I could change my workflow such that such a feature would be less valuable, potentially by:
nix(-)shell
invocationsexit
invocationsMaybe we could add an environment variable with a list of loaded packages and use that to construct a prompt by e.g. adding another function to the shell templates?
That certainly seems plausible! I would be happy to give it a try and see how it goes given sufficient time and sustained interest.[^1]
Thanks for your time!
[^1]: Or if I don't get to it in a timely fashion, maybe someone else will come along looking for the same thing, see this issue, and decide to implement it themselves? Either way, I think this issue has been (and may continue) to be useful!
Sounds good. I do wish that Nix had a "how deep in shells am I" feature.
The README currently states:
Would contributions to add this feature (showing the current shell packages) to
nix-your-shell
be desired?If showing the current shell packages is out-of-scope, I would certainly appreciate it should anyone be able to point me towards some kind of workaround or better way of accomplishing this.
Thanks!