From 996a50c5e5b38ed4453c3959d1bdfa1e83cc9086 Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Wed, 12 Sep 2018 14:20:43 +0200 Subject: [PATCH] Workaround for emoji in older shells. --- zsh/.config/zsh/.zshtheme | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zsh/.config/zsh/.zshtheme b/zsh/.config/zsh/.zshtheme index aa70820..bd65586 100644 --- a/zsh/.config/zsh/.zshtheme +++ b/zsh/.config/zsh/.zshtheme @@ -6,6 +6,13 @@ autoload -U colors && colors # Allow calling functions inside prompt setopt PROMPT_SUBST +PROMPT_VENV_INDICATOR="🐍" + +if [[ $(echo $PROMPT_VENV_INDICATOR | wc -L) -ne 2 ]]; then + # Workaround for older systems + PROMPT_VENV_INDICATOR="p:" +fi + function prompt_last_cmd() { if [[ $HISTCMD -gt 0 ]]; then echo $history[$((HISTCMD - 1))] @@ -14,7 +21,7 @@ function prompt_last_cmd() { function prompt_handle_virtualenv() { if [[ -n $VIRTUAL_ENV ]]; then - echo "%{$fg_bold[green]%}🐍 $(basename $VIRTUAL_ENV)%b%f%k " + echo "%{$fg_bold[green]%}$PROMPT_VENV_INDICATOR $(basename $VIRTUAL_ENV)%b%f%k " fi }