mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-23 12:51:58 +00:00
fix: quote % in box_name
prompt functions
This commit is contained in:
parent
43be5ea321
commit
a9d57eb2ee
3 changed files with 9 additions and 4 deletions
|
@ -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='
|
||||
|
|
|
@ -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) "
|
||||
|
||||
|
|
|
@ -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)'
|
||||
|
|
Loading…
Reference in a new issue