fix: escape path with spaces for config file

This commit is contained in:
Jan De Dobbeleer 2021-10-11 06:35:36 +02:00 committed by Jan De Dobbeleer
parent 609a534d73
commit f64a8fa51a
2 changed files with 6 additions and 6 deletions

View file

@ -22,7 +22,7 @@ function _omp_hook() {
omp_elapsed=$((omp_now-omp_start_time)) omp_elapsed=$((omp_now-omp_start_time))
rm -f "$TIMER_START" rm -f "$TIMER_START"
fi fi
PS1="$(::OMP:: --config $POSH_THEME --shell bash --error $ret --execution-time $omp_elapsed --stack-count $omp_stack_count)" PS1="$(::OMP:: --config="$POSH_THEME" --shell=bash --error="$ret" --execution-time="$omp_elapsed" --stack-count="$omp_stack_count")"
return $ret return $ret
} }
@ -43,5 +43,5 @@ function export_poshconfig() {
if [ -z "$format" ]; then if [ -z "$format" ]; then
format="json" format="json"
fi fi
::OMP:: --config $POSH_THEME --print-config --config-format $format > $1 ::OMP:: --config="$POSH_THEME" --print-config --config-format="$format" > $1
} }

View file

@ -14,7 +14,7 @@ function _omp-precmd() {
omp_now=$(::OMP:: --millis) omp_now=$(::OMP:: --millis)
omp_elapsed=$(($omp_now-$omp_start_time)) omp_elapsed=$(($omp_now-$omp_start_time))
fi fi
eval "$(::OMP:: --config $POSH_THEME --error $omp_last_error --execution-time $omp_elapsed --stack-count $omp_stack_count --eval --shell zsh)" eval "$(::OMP:: --config="$POSH_THEME" --error="$omp_last_error" --execution-time="$omp_elapsed" --stack-count="$omp_stack_count" --eval --shell=zsh)"
unset omp_start_time unset omp_start_time
unset omp_now unset omp_now
unset omp_elapsed unset omp_elapsed
@ -48,7 +48,7 @@ function export_poshconfig() {
if [ -z "$format" ]; then if [ -z "$format" ]; then
format="json" format="json"
fi fi
::OMP:: --config $POSH_THEME --print-config --config-format $format > $1 ::OMP:: --config="$POSH_THEME" --print-config --config-format="$format" > $1
} }
function self-insert() { function self-insert() {
@ -57,7 +57,7 @@ function self-insert() {
zle .self-insert zle .self-insert
return return
fi fi
tooltip=$(::OMP:: --config $POSH_THEME --shell zsh --command $BUFFER) tooltip=$(::OMP:: --config="$POSH_THEME" --shell=zsh --command="$BUFFER")
# ignore an empty tooltip # ignore an empty tooltip
if [[ ! -z "$tooltip" ]]; then if [[ ! -z "$tooltip" ]]; then
RPROMPT=$tooltip RPROMPT=$tooltip
@ -79,7 +79,7 @@ _posh-zle-line-init() {
local -i ret=$? local -i ret=$?
(( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[2] (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[2]
eval "$(::OMP:: --config $POSH_THEME --print-transient --eval --shell zsh)" eval "$(::OMP:: --config="$POSH_THEME" --print-transient --eval --shell=zsh)"
zle .reset-prompt zle .reset-prompt
# If we received EOT, we exit the shell # If we received EOT, we exit the shell