1
0
mirror of https://github.com/bertptrs/vimconfig.git synced 2025-12-25 12:30:32 +01:00

Workaround for emoji in older shells.

This commit is contained in:
2018-09-12 14:20:43 +02:00
parent e3dee2dc67
commit 996a50c5e5

View File

@@ -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
}