fix: quote % in box_name prompt functions

This commit is contained in:
Marc Cornellà
2021-12-27 15:01:25 +01:00
parent 43be5ea321
commit a9d57eb2ee
3 changed files with 9 additions and 4 deletions

View File

@@ -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)'