使用 zsh 更改 virtualenv 实例的提示样式 [英] Changing the prompt style of a virtualenv instance with zsh

查看:28
本文介绍了使用 zsh 更改 virtualenv 实例的提示样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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%}"

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

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?

推荐答案

如果您使用 virtualenvwrapper 你可以使用它的 hooks 来做到这一点.

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

这篇关于使用 zsh 更改 virtualenv 实例的提示样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆