Skip to content

Add subshell level section #355

@panurg

Description

@panurg

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⭐️ ideafeature request or suggestion🙏 help wantedneeds PR or help on decision

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions