Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Issue with precmd used to display venv in prompt
- X-seq: zsh-users 23379
- From: λ? <boojum@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Issue with precmd used to display venv in prompt
- Date: Wed, 2 May 2018 11:35:18 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stercus-accidit.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=/l72IETor44XW5pGzvlWGVy1gNDu/bfuZK3VVJW0k9I=; b=VsTq6Vl/tFIXhlPYl0EZFRjiqFPfCbDV3CZq65H9Bq6CK2P3E/A7rmpGiygWodABG4 609ZxAlNQRzkT60fBBZj+nBwsp3HEXxgGq29yZNo1dAyiGtVd4FvSonCbEWwySzueD8R fJyy7VW0yGXgLYBwl3j+VRt8QMPHGvbiQ2MLE=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
ahoy,
i've a issue with displaying current python virtualenv in prompt. it
*almost* works - precmd dose display it but it requires an extra "enter"
keypress before doing so. here's the code:
emulate -RL zsh
setopt prompt_subst
function pyenv-prompt() {
if [[ -v VIRTUAL_ENV ]]; then
VENV_P="%4F(${VIRTUAL_ENV##*/})%f"
else
VENV_P=""
fi
}
prompt_x_setup() {
function precmd() {
pyenv-prompt
}
PS1='$VENV_P > '
}
prompt_x_setup "$@"
any pointers on how i can avoid that extra "enter" will be appreciated!
--
b.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author