Skip to content

Commit

Permalink
Merge pull request #2806 from pulsovi/fix-title-at-end
Browse files Browse the repository at this point in the history
fix: /task "<taskName>" no longer works since version 1.3.20
  • Loading branch information
daxgames committed Mar 5, 2023
2 parents b3af7c3 + 92a3c9c commit 476fd2d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions launcher/src/CmderLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,6 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
swprintf_s(args, L"%s /single", args);
}

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());
Expand All @@ -445,6 +440,14 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
swprintf_s(args, L"%s %s", args, cmderConEmuArgs.c_str());
}

// The `/run` arg and its value MUST be the last arg of ConEmu
// see : https://conemu.github.io/en/ConEmuArgs.html
// > This must be the last used switch (excepting -new_console and -cur_console)
if (!streqi(cmderTask.c_str(), L""))
{
swprintf_s(args, L"%s /run {%s}", args, cmderTask.c_str());
}

SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
if (wcscmp(userConfigDirPath, configDirPath) != 0)
{
Expand Down

0 comments on commit 476fd2d

Please sign in to comment.