Closed duncairn closed 1 year ago
@duncairn Can you please attach your ConEmu.xml or user_ConEmu.xml in Cmder so we can investigate? Firstly please check if the file that you attach contains the ESP32 IDF task, thanks.
ConEmu.xml attached. ConEmu.zip
What is esp-idf
in the -cur_console:d:G:\ESP32\idf4.2\esp-idf cmd /k ""G:\ESP32\dev.espressif\idf_cmd_init.bat" "G:\Python" "G:\Tools\Git\cmd""
?
My guess would be that esp-idf
is parsing the part ""G:\ESP32\dev.espressif\idf_cmd_init.bat" "G:\Python" "G:\Tools\Git\cmd""
differently than CMD does. Specifically, the ""
might be getting turned into "
(or removed) before the cmd /k
is launched. I suspect that because that would indeed cause the final ""
to end up being considered part of %2
.
_UPDATE: never mind -- the -cur_console:d:
flag specifies a directory, so esp-idf
is part of a directory name, not a program._
Yes :) Just to confirm, I changed the folder to 'esp_idf' but it didn't fix it.
deleted
I would have put this down to cmd parsing the quotes a bit funnily, but there are two things that caused me to think it's not that:
I changed the command line to call a simple test.bat instead:
-cur_console:d:G:\ESP32\idf4.2\esp-idf cmd /k ""R:test.bat" "G:\Python\" "G:\Tools\Git\cmd\""
The contents of test.bat are:
echo 0: %0, 1: %1, 2: %2, 3: %3, 4: %4
The result of the new version Cmder.exe:
0: "R:test.bat", 1: "G:\Python\", 2: "G:\Tools\Git\cmd\"" /title "Cmder, 3: , 4:
And the old version Cmder.exe:
0: "R:test.bat", 1: "G:\Python\", 2: "G:\Tools\Git\cmd\", 3: , 4:
That, to me, implies that something has changed in Cmder.exe to cause this. Could it have been a side effect of https://github.com/cmderdev/cmder/pull/2752#issue-1409914347
@DRSDavidSoft this is a bug in the Cmder launcher:
Here is the code:
CmderLauncher.cpp
@@ -427,14 +428,19 @@
if (!streqi(cmderTask.c_str(), L""))
{
swprintf_s(args, L"%s /run {%s}", args, cmderTask.c_str());
}
+ if (!streqi(cmderTitle.c_str(), L""))
+ {
+ swprintf_s(args, L"%s /title \"%s\"", args, cmderTitle.c_str());
+ }
+
if (cfgRoot.length() != 0)
{
swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath);
}
if (!streqi(cmderConEmuArgs.c_str(), L""))
{
swprintf_s(args, L"%s %s", args, cmderConEmuArgs.c_str());
}
But the ConEmu documentation states about the /run
switch that "This must be the last used switch (excepting -new_console and -cur_console)."
So the Cmder launcher is appending /title
and -loadcfgfile
in an incorrect position in the command line.
Depending on what cmderConEmuArgs.c_str()
can contain, it may be getting appended in an incorrect position as well.
Thanks very much, @chrisant996
@chrisant996 Hi there, thanks for the investigation and the fix, this issue has been closed by #2806. Sorry I've been super busy these couple of weeks, will be back for the other fixes soon.
Version Information
Cmder Edition
Cmder Full (with Git)
Description of the issue
I have a task which initially calls a setup .bat file.
-cur_console:d:G:\ESP32\idf4.2\esp-idf cmd /k ""G:\ESP32\dev.espressif\idf_cmd_init.bat" "G:\Python\" "G:\Tools\Git\cmd\""
Within that file is the following line: if "%~2"=="" (
If I call Cmdr with that task as the argument (that is, this is the initial task) the .bat fails with "The syntax of the command is incorrect" at that line. The displayed output from the .bat is: G:\ESP32\idf4.2\esp-idf>if "G:\Tools\Git\cmd\"" /title "Cmder"=="" (
If I start Cmdr with the default task, and then start this task in a new tab, it works perfectly and the output of that line is: G:\ESP32\idf4.2\esp-idf>if "G:\Tools\Git\cmd\" == "" (
If I switch Cmder.exe for a previous version (V1.3.14, which is what I used before) there is no problem.
How to reproduce
No response
Additional context
No response
Checklist