cmder: Really slow prompt inside large git repositories even after disabling git status.

Purpose of the issue

  • Bug report (encountered problems/errors)

Version Information

Cmder v1.3.17.1082, ConEmu v191012

Description of the issue

Even after you disable git status with the instructions provided in the README file, prompts appear after much delay inside large git repos. Deleting vendor\clink-completions\git_prompt.lua does the trick, however.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 32 (26 by maintainers)

Most upvoted comments

what’s the specific reason git_prompt is implemented in two places? Can’t we just delete one of the instances, and call it a day?

One is part of the clink-completions vendor package, which is also used independently from Cmder.

Since Cmder needs some different behaviors, it’s not as simple as just deleting one of them.

However, there are other options:

  1. Could use the Clink API settings.add to create a Clink setting for opting out. And then both implementations could use the same setting. (Requires new Clink; won’t work with Clink 0.4.9). This would change how one opts out, but it would be possible to add code in vendor\clink.lua to automatically migrate the setting from git config.
  2. Could make a global variable or function in the vendor\clink.lua file for checking whether git status is opted out. Could make the clink-completions version check whether the Cmder-specific bar/func exists, and respond accordingly. Then clink-completions could with with/without Cmder, without needing to change how you opt out in Cmder.
  3. Could give up and make clink-completions look at cmder git config settings directly. Less clean of an approach, though.
  4. (There are many other variations of options, too.)

My vote would be for option 2, so far.

Yes. But Cmder also includes a whole separate copy of the source control prompt filters, inside vendor\clink-completions.

The git prompt filter in vendor\clink.lua checks git config. The git prompt filter in vendor\clink-completions\git_prompt.lua does not check git config.

So, the instructions and mechanism for opting out of git status aren’t effective.

Apparently Cmder has two git prompt filters.

  • The one inside vendor\clink.lua checks the cmder.status and cmder.cmdstatus git config settings.
  • The one inside vendor\clink-completions\git_prompt.lua does not.
    • And the clink-completions repo is not specific to Cmder, so when adding a check it will need a way to know that it’s embedded in Cmder and only check in that case.

Also, having two separate git prompt filters (and mercurial, and etc) might additionally be doubling the delay by doing everything twice.