From a8165427e98f1fb34b5d02057ff68b68c5dcceec Mon Sep 17 00:00:00 2001 From: Marc Coury Date: Wed, 24 Oct 2018 11:12:49 +0100 Subject: [PATCH] two step evaluation of prompt to reduce time on setting universal variable Unfortunately this doesn't fix the error: ` fish: Locking the universal var file took too long (1.004 seconds).` I think that error is caused by too many threads waiting on the universal file lock: https://github.com/fish-shell/fish-shell/blob/master/src/env_universal_common.cpp#L569 --- conf.d/__async_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.d/__async_prompt.fish b/conf.d/__async_prompt.fish index 9243f4c..214869a 100644 --- a/conf.d/__async_prompt.fish +++ b/conf.d/__async_prompt.fish @@ -65,7 +65,7 @@ and begin set st $status for func in (__async_prompt_config_functions) - __async_prompt_config_inherit_variables | __async_prompt_spawn $st 'set -U __async_prompt_'$func'_text_'(__async_prompt_pid)' ('$func')' + __async_prompt_config_inherit_variables | __async_prompt_spawn $st 'set -l prompt ('$func'); and set -U __async_prompt_'$func'_text_'(__async_prompt_pid)' $prompt' function '__async_prompt_'$func'_handler' --on-process-exit (jobs -lp | tail -n1) kill -WINCH (__async_prompt_pid) sleep 0.1