mirror of
https://github.com/cmderdev/cmder.git
synced 2025-02-11 16:00:21 +08:00
Adding single mode support.
This commit is contained in:
parent
dcc9f5e59a
commit
0f295234cc
@ -79,7 +79,7 @@ optpair GetOption()
|
|||||||
return pair;
|
return pair;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartCmder(std::wstring path)
|
void StartCmder(std::wstring path, bool is_single_mode)
|
||||||
{
|
{
|
||||||
#if USE_TASKBAR_API
|
#if USE_TASKBAR_API
|
||||||
wchar_t appId[MAX_PATH] = { 0 };
|
wchar_t appId[MAX_PATH] = { 0 };
|
||||||
@ -102,7 +102,14 @@ void StartCmder(std::wstring path)
|
|||||||
PathCombine(cfgPath, exeDir, L"config\\ConEmu.xml");
|
PathCombine(cfgPath, exeDir, L"config\\ConEmu.xml");
|
||||||
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe");
|
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe");
|
||||||
|
|
||||||
|
if (is_single_mode)
|
||||||
|
{
|
||||||
|
swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
swprintf_s(args, L"/Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
|
swprintf_s(args, L"/Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
|
||||||
|
}
|
||||||
|
|
||||||
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
|
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
|
||||||
SetEnvironmentVariable(L"CMDER_START", path.c_str());
|
SetEnvironmentVariable(L"CMDER_START", path.c_str());
|
||||||
@ -229,7 +236,11 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
|
|
||||||
if (streqi(opt.first.c_str(), L"/START"))
|
if (streqi(opt.first.c_str(), L"/START"))
|
||||||
{
|
{
|
||||||
StartCmder(opt.second);
|
StartCmder(opt.second, false);
|
||||||
|
}
|
||||||
|
else if (streqi(opt.first.c_str(), L"/SINGLE"))
|
||||||
|
{
|
||||||
|
StartCmder(opt.second, true);
|
||||||
}
|
}
|
||||||
else if (streqi(opt.first.c_str(), L"/REGISTER"))
|
else if (streqi(opt.first.c_str(), L"/REGISTER"))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user