使用zsh更改virtualenv实例的提示样式

Jér*_*eot 10 python zsh virtualenv

我想为我使用或创建的每个virtualenv实例更改我的zsh提示样式.我的实际提示是这样的:

declare PS1="%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%3~%{$reset_color%}"
Run Code Online (Sandbox Code Playgroud)

当我激活virtualenv时,它只是在提示之前添加一些信息:

(the name of my venv)my_prompt
Run Code Online (Sandbox Code Playgroud)

你知道改变颜色或款式的方法吗?

Ian*_*ing 13

如果你使用virtualenvwrapper,你可以使用它的钩子来做到这一点.