mirror of
https://github.com/bertptrs/vimconfig.git
synced 2025-12-27 13:30:31 +01:00
Workaround for emoji in older shells.
This commit is contained in:
@@ -6,6 +6,13 @@ autoload -U colors && colors
|
|||||||
# Allow calling functions inside prompt
|
# Allow calling functions inside prompt
|
||||||
setopt PROMPT_SUBST
|
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() {
|
function prompt_last_cmd() {
|
||||||
if [[ $HISTCMD -gt 0 ]]; then
|
if [[ $HISTCMD -gt 0 ]]; then
|
||||||
echo $history[$((HISTCMD - 1))]
|
echo $history[$((HISTCMD - 1))]
|
||||||
@@ -14,7 +21,7 @@ function prompt_last_cmd() {
|
|||||||
|
|
||||||
function prompt_handle_virtualenv() {
|
function prompt_handle_virtualenv() {
|
||||||
if [[ -n $VIRTUAL_ENV ]]; then
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user