Changing the prompt style of a virtualenv instance with zsh

孤者浪人 提交于 2019-11-30 02:42:14

问题


I would like the change my zsh prompt style for every virtualenv instances that I use or create. My actual prompt is like this:

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

When I activate a virtualenv it just adds some information before the prompt:

(the name of my venv)my_prompt

Do you know a way to change the colors or styles?


回答1:


If you use virtualenvwrapper you can use its hooks to do this.




回答2:


And you can use virtualenvwrapper plugin in the ~/.zshrc,Don't use virtualenv plugin together with virtualenvwrapper.



来源:https://stackoverflow.com/questions/3646014/changing-the-prompt-style-of-a-virtualenv-instance-with-zsh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!