Fix: Break prompt line when prompt is too long.
This commit is contained in:
@@ -96,9 +96,9 @@ build_prompt() {
|
|||||||
PROMPT+=$prompt_ext_text
|
PROMPT+=$prompt_ext_text
|
||||||
|
|
||||||
# build prompt suffix
|
# build prompt suffix
|
||||||
local prompt_nocolor=$(echo $PROMPT | perl -pe "s/%\{[^}]+\}//g")
|
local prompt_nocolor=$(echo ${PROMPT} | perl -pe "s/%\{[^}]+\}//g")
|
||||||
local prompt_length=${#prompt_nocolor}
|
local prompt_length=${#${(%)prompt_nocolor}}
|
||||||
if [[ $prompt_length -gt 40 ]]; then
|
if [[ $prompt_length -gt 45 ]]; then
|
||||||
PROMPT+=$(prompt_segment cyan '\n%{\r%}⇒ ')
|
PROMPT+=$(prompt_segment cyan '\n%{\r%}⇒ ')
|
||||||
else
|
else
|
||||||
PROMPT+=$(prompt_segment cyan ' ⇒ ')
|
PROMPT+=$(prompt_segment cyan ' ⇒ ')
|
||||||
|
|||||||
Reference in New Issue
Block a user