8c8782e36250cf85e3c0fc2e8391e7742b1ac3aa

Author
kapil971390 <kapil69265@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(josh): escape % in branch before computing branch_size (#13835)

Co-authored-by: kapilvus <kapilvus@gmail.com>

Diff

 1diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme
 2index e8ae18dda289defa12e48ea623e686fb18417452..ead1fadfa13e4f677a51e65bfa12f9d02b5bb771 100644
 3--- a/themes/josh.zsh-theme
 4+++ b/themes/josh.zsh-theme
 5@@ -10,6 +10,7 @@ function josh_prompt {
 6   prompt=" "
 7 
 8   branch=$(git_current_branch)
 9+  branch="${branch//\%/%%}"
10   ruby_version=$(ruby_prompt_info)
11   path_size=${#PWD}
12   branch_size=${#branch}
13@@ -31,7 +32,7 @@ function josh_prompt {
14     prompt=" $prompt"
15   done
16 
17-  prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(ruby_prompt_info)%{$reset_color%} ${branch//\%/%%}"
18+  prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(ruby_prompt_info)%{$reset_color%} ${branch}"
19 
20   echo $prompt
21 }