-
-
Notifications
You must be signed in to change notification settings - Fork 140
Description
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?