Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Update the environment in the async worker before building the prompt
Browse files Browse the repository at this point in the history
This has to be done, so that the worker has knowledge of all the
variables set that might be used by segments.
  • Loading branch information
dritter committed Jul 4, 2019
1 parent b8de242 commit 5e72735
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions generator/default.p9k
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,9 @@ function __p9k_prepare_prompts() {
_P9K_TIMER_START=0x7FFFFFFF

if [[ "${__P9K_DATA[async]}" == "true" ]]; then
# stop any running async jobs
async_flush_jobs "__p9k_async_worker"
# Update the current working directory of the async worker.
async_worker_eval "__p9k_async_worker" builtin cd -q $PWD
# Restart worker to update the environment inside the worker
async_stop_worker "__p9k_async_worker"
async_start_worker "__p9k_async_worker"
fi

__p9k_build_segment_cache "left"
Expand All @@ -579,7 +578,6 @@ p9k::set_default P9K_IGNORE_TERM_LANG false
# @noargs
##
function __p9k_ch_pwd() {
__p9k_prepare_prompts
__p9k_preexec
}

Expand Down

0 comments on commit 5e72735

Please sign in to comment.