mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-07-24 05:57:47 +02:00
fix(josh): escape % in branch before computing branch_size (#13835)
Co-authored-by: kapilvus <kapilvus@gmail.com>
This commit is contained in:
parent
51e98fadc9
commit
8c8782e362
1 changed files with 2 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ function josh_prompt {
|
||||||
prompt=" "
|
prompt=" "
|
||||||
|
|
||||||
branch=$(git_current_branch)
|
branch=$(git_current_branch)
|
||||||
|
branch="${branch//\%/%%}"
|
||||||
ruby_version=$(ruby_prompt_info)
|
ruby_version=$(ruby_prompt_info)
|
||||||
path_size=${#PWD}
|
path_size=${#PWD}
|
||||||
branch_size=${#branch}
|
branch_size=${#branch}
|
||||||
|
|
@ -31,7 +32,7 @@ function josh_prompt {
|
||||||
prompt=" $prompt"
|
prompt=" $prompt"
|
||||||
done
|
done
|
||||||
|
|
||||||
prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(ruby_prompt_info)%{$reset_color%} ${branch//\%/%%}"
|
prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(ruby_prompt_info)%{$reset_color%} ${branch}"
|
||||||
|
|
||||||
echo $prompt
|
echo $prompt
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue