If the path variable contained values with an ampersand character (such as in the case of MySQL), the string splits by this character, and tries to execute what follows as a separate command.
All occurrences of the set command containing %PATH% should be wrapped in quotation marks
The Cmder prompt normally includes version control info, which involves
running some potentially expensive commands. The cmder-powerline-prompt
project (and maybe other projects) replaces the Cmder prompt and runs
the same potentially expensive commands -- so expensive commands get run
twice!
This change makes it possible for the user and/or other scripts to
disable the version control part of the built-in Cmder prompt.
https://github.com/chrisant996/cmder-powerline-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.
`git status` and `git diff` can be slow in large repos. Clink v1.2.10
and higher support using Lua coroutines to do expensive parts of prompt
filtering in the background. When the expensive parts complete, the
prompt gets refreshed.
This means even large repos can have fast prompts PLUS git status all
the time!
This change should be backward/forward compatible with both older and
newer versions of Clink (of course only newer versions will gain the
benefit).
The default setting for path enhancing is appending,
so the provided unix tools don't overwrite windows tools we may want to keep.
For Git this is undesired behavior, though, as we just compared git versions
to decide which one we want to use. The git directory thus needs to be prepended
to the path to make sure a call to git uses the version we selected.
It is hard to spot without the brackets, but the last else block - that resets %test_dir% and
logs in verbose mode that an older user git version will be ignored - can't actually be reached.
The else block is considered to belong to the if clause "if exist "%test_dir:~0,-4%\cmd\git.exe""
that will only ever be executed if ERRORLEVEL is greather than or equal to 0, thus if the test fails,
the following else if clause "else if ERRORLEVEL 0" will always succeed and the last else block will be ignored.
Using the vendored git version may still have worked because %GIT_INSTALL_ROOT% isn't set either way,
but to enable the log message I reordered if-else-clauses and brackets in the way I think the
original author intended them to work.
%errorlevel% was always 0, even if the vendored git version was more current than the installed one
Usually exiting a batch script with "exit /b exitCode" as used in :compare_versions
sets %errorlevel% to the specified exit code
However, this may not work if %errorlevel% was set before with "Set errorlevel="
I didn't find the location where this might have happened,
but I saw the consequence of %errorlevel% always being 0
Thus I decided to use ERRORLEVEL instead as this will always work regardless of environment variable
For more information check https://ss64.com/nt/errorlevel.html
The startup time duration is calculated wrongly ( at least for me, on Windows 1909, with CmderMini 1.3.15.1010 ). I got something like "Elapsed Time: 80:36:1.00 (290161.00s total)" printed into the cmder consle window. I can be solved by quoting the time measures taken in `init.bat`.
It seems that `time.cmd` fails in recognizing two arguments. In fact it did split the first time measure into two arguments and ignored the second time measure.
Example:
from the two time measures
λ echo %CMDER_INIT_START% %CMDER_INIT_END%
12:53:44,34 12:53:54,04
The call to `time.cmd` created following output (i added echo commands to print variables start and end right after they got assigned the arguments)
start: 12:53:44
end: 34