From e5257f257d77a8b5374d886066c4d6e3a4c8b0bf Mon Sep 17 00:00:00 2001 From: Thomas Schneider Date: Mon, 27 Jul 2026 19:00:40 +0200 Subject: zsh: Add esp-idf and perl local::lib to virtualenv prompt --- dot.zshrc.from_grml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dot.zshrc.from_grml b/dot.zshrc.from_grml index d9050ca..ac0e43e 100644 --- a/dot.zshrc.from_grml +++ b/dot.zshrc.from_grml @@ -1,3 +1,4 @@ +# -*- shell-script -*- ## Settings for umask if (( EUID == 0 )); then umask 002 @@ -8,7 +9,20 @@ fi # Virtualenv support function virtual_env_prompt () { - REPLY=${VIRTUAL_ENV+(${VIRTUAL_ENV:t}) } + emulate -L zsh + + if (( ${+VIRTUAL_ENV_PROMPT} )); then + REPLY="(py:${VIRTUAL_ENV_PROMPT}) " + elif (( ${+VIRTUAL_ENV} )); then + REPLY="(py:${VIRTUAL_ENV:t}) " + elif (( ${+IDF_PYTHON_ENV_PATH} )); then + REPLY="(idf:${IDF_PYTHON_ENV_PATH:t}) " + fi + + if (( ${+PERL_LOCAL_LIB_ROOT} )); then + local -a dirs=( ${(s/:/)PERL_LOCAL_LIB_ROOT} ) + REPLY+="(pl:${(@j/:/)dirs:t}) " + fi } grml_theme_add_token virtual-env -f virtual_env_prompt '%F{magenta}' '%f' zstyle ':prompt:grml:left:setup' items rc virtual-env change-root user at host path vcs percent @@ -71,4 +85,4 @@ plap() { else ls -l ${^path}/*$1*(*N) fi -} \ No newline at end of file +} -- cgit v1.2.3