开发者

ZSH `rvm-prompt` on RHS prompt not refreshing

开发者 https://www.devze.com 2023-03-23 09:33 出处:网络
I have rvm-prompt feeding into my RPrompt, however it is not refreshing between commands:(Larger image)

I have rvm-prompt feeding into my RPrompt, however it is not refreshing between commands:

ZSH `rvm-prompt` on RHS prompt not refreshing

(Larger image)

For example, when I cd from one ruby project to another with an .rvmrc file pointing to a new gemset, the rprompt simply will not refresh. It appears that it must be caching the rprompt for performance purposes, so I am curious as to how I can force a refresh for 开发者_JS百科zsh at each command?


How do you generate the prompt? I do it like this:

local rvm_ruby=' %{$fg[red]%}[$(~/.rvm/bin/rvm-prompt i v g s)]%{$reset_color%}'

And then use the rvm_ruby variable in my prompt:

PROMPT="${user_host}${directory}${git_branch}${rvm_ruby}%B
→%b "

EDIT: Note that the place where you create the contents for the variable needs single quotes, otherwise the command will get substituted right away and not updated anymore. This initially took me a bit to figure out. You may have the same problem defining your RHS prompt.

0

精彩评论

暂无评论...
验证码 换一张
取 消