MercuryTechnologies / nix-your-shell

A `nix` and `nix-shell` wrapper for shells other than `bash`
MIT License
85 stars 12 forks source link

Interest in "show current shell packages" feature? #74

Open ChanceHarrison opened 4 weeks ago

ChanceHarrison commented 4 weeks ago

The README currently states:

However, any-nix-shell can optionally display the packages in the current shell on a righthand prompt. nix-your-shell does not support this.

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!

9999years commented 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?

ChanceHarrison commented 4 weeks ago

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:

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?

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!

9999years commented 4 weeks ago

Sounds good. I do wish that Nix had a "how deep in shells am I" feature.