Skip to content

Commit

Permalink
fix(zsh): adjust prompt commands to standard
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Mar 11, 2022
1 parent a714b6a commit 62c1581
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/engine/init/omp.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export CONDA_PROMPT_MODIFIER=false
# set secondary prompt
PS2="$(::OMP:: --config="$POSH_THEME" --shell=zsh --print-secondary)"

function _omp-preexec() {
function prompt_ohmyposh_preexec() {
omp_start_time=$(::OMP:: --millis)
}

function _omp-precmd() {
function prompt_ohmyposh_precmd() {
omp_last_error=$?
omp_stack_count=${#dirstack[@]}
omp_elapsed=-1
Expand All @@ -27,18 +27,18 @@ function _omp-precmd() {

function _install-omp-hooks() {
for s in "${preexec_functions[@]}"; do
if [ "$s" = "_omp-preexec" ]; then
if [ "$s" = "prompt_ohmyposh_preexec" ]; then
return
fi
done
preexec_functions+=(_omp-preexec)
preexec_functions+=(prompt_ohmyposh_preexec)

for s in "${precmd_functions[@]}"; do
if [ "$s" = "_omp-precmd" ]; then
if [ "$s" = "prompt_ohmyposh_precmd" ]; then
return
fi
done
precmd_functions+=(_omp-precmd)
precmd_functions+=(prompt_ohmyposh_precmd)
}

if [ "$TERM" != "linux" ]; then
Expand Down

0 comments on commit 62c1581

Please sign in to comment.