From 91aabe75af71e8621cba50dc5d1f64bff127acfd Mon Sep 17 00:00:00 2001 From: Chris Antos Date: Thu, 10 Jun 2021 18:49:39 -0700 Subject: [PATCH] Add prompt config variable for async git prompt. Setting `prompt_overrideGitStatusOptIn = true` will override the `cmder.status` and `cmder.cmdstatus` git config settings and run the git prompt status commands in the background. But it only takes effect when using Clink v1.2.10, since that's required in order to run prompt update commands in the background. --- vendor/clink.lua | 6 +++--- vendor/cmder_prompt_config.lua.default | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/vendor/clink.lua b/vendor/clink.lua index 7fbf55a..3bd5b72 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -74,9 +74,9 @@ local cached_info = {} if clink.promptcoroutine and io.popenyield then io_popenyield = io.popenyield clink_promptcoroutine = clink.promptcoroutine - -- Uncommenting this will override the cmderGitStatusOptIn and always show - -- git status when Clink is able to run it in the background. - --cmderForceAsyncGitStatus = true + if prompt_overrideGitStatusOptIn then + cmderForceAsyncGitStatus = true + end else io_popenyield = io.popen clink_promptcoroutine = function (func) diff --git a/vendor/cmder_prompt_config.lua.default b/vendor/cmder_prompt_config.lua.default index e5ae224..045a0d7 100644 --- a/vendor/cmder_prompt_config.lua.default +++ b/vendor/cmder_prompt_config.lua.default @@ -29,6 +29,11 @@ prompt_useUserAtHost = false -- default is false prompt_singleLine = false +-- OPTIONAL. If true then always ignore the cmder.status and cmder.cmdstatus git config settings and run the git prompt commands in the background. + -- default is false + -- NOTE: This only takes effect if using Clink v1.2.10 or higher. +prompt_overrideGitStatusOptIn = false + -- Prompt Attributes -- -- Colors