我想为我使用或创建的每个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)
你知道改变颜色或款式的方法吗?
当我激活 python 虚拟环境时,fish 总是在 Fish 提示之前在括号中打印 venv 名称。
antonio:~/W/s/src >
antonio:~/W/s/src > source ../env/bin/activate.fish
(env) antonio:~/W/s/src >
Run Code Online (Sandbox Code Playgroud)
我想避免这种(env)情况并通过我的自定义 Fish_prompt 函数处理虚拟环境。
没关系,我有什么代码~/.config/fish/functions/fish_prompt.fish- Fish 总是打印,并且只有在执行我的函数(env)之后fish_prompt.fish