a9d57eb2eec4d6234c4714a430ddfb4c57443570
- Author
- Marc Cornellà <hello@mcornella.com>
- Committer
- Marc Cornellà <hello@mcornella.com>
- Date
Message
fix: quote % in `box_name` prompt functions
Diff
1diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme
2index ad03cc32076f2901688d4431285909cb8a31ead8..31e63df151c2a3b910676b5ee3e0cdc6d4549587 100644
3--- a/themes/candy-kingdom.zsh-theme
4+++ b/themes/candy-kingdom.zsh-theme
5@@ -11,7 +11,9 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset
6 fi
7
8 function box_name {
9- [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
10+ local box="${SHORT_HOST:-$HOST}"
11+ [[ -f ~/.box-name ]] && box="$(< ~/.box-name)"
12+ echo "${box:gs/%/%%}"
13 }
14
15 PROMPT='
16diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme
17index 57c47db02cb9f914d242db467b07b3ee5ae05e3d..c7e2d965ecb37c20950a6dc91a7d10ae5e18fe22 100644
18--- a/themes/fino-time.zsh-theme
19+++ b/themes/fino-time.zsh-theme
20@@ -21,10 +21,11 @@ function prompt_char {
21 }
22
23 function box_name {
24- [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
25+ local box="${SHORT_HOST:-$HOST}"
26+ [[ -f ~/.box-name ]] && box="$(< ~/.box-name)"
27+ echo "${box:gs/%/%%}"
28 }
29
30-
31 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 - %*
32 ╰─\$(virtualenv_info)\$(prompt_char) "
33
34diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme
35index 2523c1776a171695ba7de8822211e70753a6b939..9365a3c42c68c76729e7d9b2316f1e5b9050e391 100644
36--- a/themes/fino.zsh-theme
37+++ b/themes/fino.zsh-theme
38@@ -21,7 +21,9 @@ function prompt_char {
39 }
40
41 function box_name {
42- [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
43+ local box="${SHORT_HOST:-$HOST}"
44+ [[ -f ~/.box-name ]] && box="$(< ~/.box-name)"
45+ echo "${box:gs/%/%%}"
46 }
47
48 local ruby_env='$(ruby_prompt_info)'