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