diff options
author | Marc Cornellà <hello@mcornella.com> | 2021-12-27 15:01:25 +0100 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2022-01-03 13:50:52 +0100 |
commit | a9d57eb2eec4d6234c4714a430ddfb4c57443570 (patch) | |
tree | e146faf18766efe8ee88c336cfecd95b496ab61b /themes | |
parent | 43be5ea32150912ae2e85e2cc278c092022ea53f (diff) | |
download | zsh-a9d57eb2eec4d6234c4714a430ddfb4c57443570.tar.gz zsh-a9d57eb2eec4d6234c4714a430ddfb4c57443570.tar.bz2 zsh-a9d57eb2eec4d6234c4714a430ddfb4c57443570.zip |
fix: quote % in `box_name` prompt functions
Diffstat (limited to 'themes')
-rw-r--r-- | themes/candy-kingdom.zsh-theme | 4 | ||||
-rw-r--r-- | themes/fino-time.zsh-theme | 5 | ||||
-rw-r--r-- | themes/fino.zsh-theme | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme index ad03cc320..31e63df15 100644 --- a/themes/candy-kingdom.zsh-theme +++ b/themes/candy-kingdom.zsh-theme @@ -11,7 +11,9 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset fi function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} + local box="${SHORT_HOST:-$HOST}" + [[ -f ~/.box-name ]] && box="$(< ~/.box-name)" + echo "${box:gs/%/%%}" } PROMPT=' diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme index 57c47db02..c7e2d965e 100644 --- a/themes/fino-time.zsh-theme +++ b/themes/fino-time.zsh-theme @@ -21,10 +21,11 @@ function prompt_char { } function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} + local box="${SHORT_HOST:-$HOST}" + [[ -f ~/.box-name ]] && box="$(< ~/.box-name)" + echo "${box:gs/%/%%}" } - PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}\$(git_prompt_info)\$(ruby_prompt_info) %D - %* ╰─\$(virtualenv_info)\$(prompt_char) " diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 2523c1776..9365a3c42 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -21,7 +21,9 @@ function prompt_char { } function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} + local box="${SHORT_HOST:-$HOST}" + [[ -f ~/.box-name ]] && box="$(< ~/.box-name)" + echo "${box:gs/%/%%}" } local ruby_env='$(ruby_prompt_info)' |