mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-07-22 04:35:13 +02:00
fix(josh): escape % in branch before computing branch_size (#13835)
Co-authored-by: kapilvus <kapilvus@gmail.com>
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user