zsh在使用prezto的同一级别上有正确的提示

时间:2016-03-31 21:03:24

标签: git zsh prezto zsh-zle

我是zshprezto的新手。现在,就像在我的bash shell中一样,我希望左边的当前路径和右边的当前分支,正如你在图片中看到的那样好到目前为止.....

Prompt

...现在问题是提示的正确部分是在第二行而不是路径所在的那部分!

# Define prompts.
PROMPT="
[ ${_prompt_steeef_colors[3]}%n%f@${_prompt_steeef_colors[2]}%m%f ] ${_prompt_steeef_colors[5]}%~%f 
"'$python_info[virtualenv]'"$ "
RPROMPT='${vcs_info_msg_0_}'

(完整源代码:here

  

如何在自定义中的同一行实现路径和分支   prezto提示?

1 个答案:

答案 0 :(得分:1)

如果您在调整窗口大小时不关心渲染工件,可以使用控制字符来破解此功能:

local _lineup=$'\e[1A'
local _linedown=$'\e[1B'
RPROMPT=%{${_lineup}%}"some stuff"%{${_linedown}%}

我在这里找到了这个:https://superuser.com/questions/357107/zsh-right-justify-in-ps1/737454#737454

相关问题