Plugin provides singularityenv_prompt_info function which returns the current singularity environment name.
-
Download the plugin
git clone https://github.com/saravanabalagi/zsh-plugin-singularityenv $ZSH_CUSTOM/plugins/singularityenv -
Add to
pluginsin.zshrcfileplugins=( ... singularityenv )
Then launch a new terminal or source .zshrc in your current terminal.
This plugin exposes:
singularityenv_prompt_infofunction based on two env varsZSH_THEME_SINGULARITYENV_PREFIXdefault(ZSH_THEME_SINGULARITYENV_SUFFIXdefault)
Using this you can build a theme as below:
base_prompt=PROMPT
PROMPT=$(singularityenv_prompt_info)"$base_prompt"
ZSH_THEME_SINGULARITYENV_PREFIX="%{$fg[blue]%}("
ZSH_THEME_SINGULARITYENV_SUFFIX=")%{$reset_color%}"Please refer to the License file.
