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

2024-05-16 14:13:40 发布

您现在位置:Python中文网/ 问答频道 /正文

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

declare PS1="%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%3~%{$reset_color%}"

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

(the name of my venv)my_prompt

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


Tags: 实例invirtualenvmy样式greenatzsh