Skip to content
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

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

Open
ChanceHarrison opened this issue Jun 5, 2024 · 3 comments
Open

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

ChanceHarrison opened this issue Jun 5, 2024 · 3 comments

Comments

@ChanceHarrison
Copy link

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
Copy link
Member

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
Copy link
Author

We met at NixCon, right?

Yes, we did! Hello again! 👋

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:

  • not juggling so many shells
  • using something like comma instead of trying so hard to be cognizant of any current nix(-)shell invocations
  • just closing the terminal (pane/tab/window) instead of using an unknown quantity of exit invocations

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!

Footnotes

  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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants