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

Add subshell level section #355

Open
panurg opened this issue Sep 10, 2024 · 0 comments
Open

Add subshell level section #355

panurg opened this issue Sep 10, 2024 · 0 comments
Labels
🙏 help wanted needs PR or help on decision ⭐️ idea feature request or suggestion

Comments

@panurg
Copy link

panurg commented Sep 10, 2024

Env

Pure

echo $pure_version
4.11.0

Fish

fish --version
fish, version 3.7.1

OS/distribution

lsb_release -a
No LSB modules are available.
Distributor ID:	NixOS
Description:	NixOS 24.05 (Uakari)
Release:	24.05
Codename:	uakari

Background

I frequently use nix shell to make an environment with some additional tools in NixOS. I want some indication of that environment. There is a pure_enable_nixdevshell option, but it is only applicable for nix develop shell. Unfortunately there is no way to determine nix shell environment (see NixOS/nix#6677). Luckily fish provides SHLVL variable for subshell counting. It can be a solution for my problem. It is also can be somehow applicable in non-NixOS distributions.

Solution

Add a feature to display subshell level when it is greater than 2 by inspecting SHLVL variable.

I wanted to implement it by myself, but seems pure does not offer custom section. BTW it could be a great feature too. Probably there is other way without patching code which I would like to avoid?

@edouard-lopez edouard-lopez added ⭐️ idea feature request or suggestion 🙏 help wanted needs PR or help on decision labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 help wanted needs PR or help on decision ⭐️ idea feature request or suggestion
Projects
None yet
Development

No branches or pull requests

2 participants