From 32e27c9fb614fbfe026385ba71ab3f024286c262 Mon Sep 17 00:00:00 2001 From: Junker <1144095+Junker@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:14:23 +0700 Subject: [PATCH] add guix shell integration --- pure.zsh | 7 +++++++ readme.md | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/pure.zsh b/pure.zsh index 172958c2..621aa1c7 100644 --- a/pure.zsh +++ b/pure.zsh @@ -236,6 +236,13 @@ prompt_pure_precmd() { fi fi + # Guix package manager integration. If used from within 'guix shell' + if zstyle -T ":prompt:pure:environment:guix-shell" show; then + if [[ -n $GUIX_ENVIRONMENT ]]; then + psvar[12]="[env]" + fi + fi + # Make sure VIM prompt is reset. prompt_pure_reset_prompt_symbol diff --git a/readme.md b/readme.md index 131bb07b..818d0163 100644 --- a/readme.md +++ b/readme.md @@ -98,6 +98,10 @@ You can set Pure to only `git fetch` the upstream branch of the current local br `zstyle :prompt:pure:environment:nix-shell show no` +`guix-shell` integration adds the "[env]" to the prompt when used from within a guix shell. It is enabled by default, you can disable it with: + +`zstyle :prompt:pure:environment:guix-shell show no` + ## Colors As explained in ZSH's [manual](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting), color values can be: