在zsh中更改virtualenv实例的提示样式
我想要改变我在使用或创建每个虚拟环境时的 zsh 提示样式。现在我的提示样式是这样的:
declare PS1="%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%3~%{$reset_color%}"
当我激活一个虚拟环境时,它会在提示前面加上一些信息:
(the name of my venv)my_prompt
你知道有什么方法可以改变颜色或样式吗?
2 个回答
3
你可以在你的 ~/.zshrc 文件中使用 virtualenvwrapper 插件。不要把 virtualenv 插件和 virtualenvwrapper 一起使用哦。
13
如果你使用 virtualenvwrapper 这个工具,你可以利用它的 钩子 来实现这个功能。