@@ -299,7 +299,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
299299 // Set path to Cmder user ConEmu config file
300300 PathCombine (userCfgPath, userConfigDirPath, L" user-ConEmu.xml" );
301301 }
302-
302+
303303 if (wcscmp (cpuCfgPath, L" " ) != 0 && (PathFileExists (cpuCfgPath) || use_user_cfg == false )) // config/[host specific terminal emulator config] file exists or /m was specified on command line, use machine specific config.
304304 {
305305 if (cfgRoot.length () == 0 ) // '/c [path]' was NOT specified
@@ -356,7 +356,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
356356 {
357357 if (!CopyFile (cfgPath, userCfgPath, FALSE ))
358358 {
359- if (PathFileExists (windowsTerminalDir)) {
359+ if (PathFileExists (windowsTerminalDir))
360+ {
360361 MessageBox (NULL ,
361362 (GetLastError () == ERROR_ACCESS_DENIED)
362363 ? L" Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_settings.json! Access Denied."
@@ -377,7 +378,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
377378 {
378379 if (!CopyFile (userCfgPath, cfgPath, FALSE ))
379380 {
380- if (PathFileExists (windowsTerminalDir)) {
381+ if (PathFileExists (windowsTerminalDir))
382+ {
381383 MessageBox (NULL ,
382384 (GetLastError () == ERROR_ACCESS_DENIED)
383385 ? L" Failed to copy config/user_windows_terminal_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
@@ -405,7 +407,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
405407 {
406408 if (!CopyFile (cfgPath, userCfgPath, FALSE ))
407409 {
408- if (PathFileExists (windowsTerminalDir)) {
410+ if (PathFileExists (windowsTerminalDir))
411+ {
409412 MessageBox (NULL ,
410413 (GetLastError () == ERROR_ACCESS_DENIED)
411414 ? L" Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings.json! Access Denied."
@@ -425,7 +428,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
425428 {
426429 if (!CopyFile (defaultCfgPath, cfgPath, FALSE ))
427430 {
428- if (PathFileExists (windowsTerminalDir)) {
431+ if (PathFileExists (windowsTerminalDir))
432+ {
429433 MessageBox (NULL ,
430434 (GetLastError () == ERROR_ACCESS_DENIED)
431435 ? L" Failed to copy vendor/windows-terminal_default_settings_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
@@ -456,7 +460,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
456460 {
457461 if (!CopyFile (cfgPath, userCfgPath, FALSE ))
458462 {
459- if (PathFileExists (windowsTerminalDir)) {
463+ if (PathFileExists (windowsTerminalDir))
464+ {
460465 MessageBox (NULL ,
461466 (GetLastError () == ERROR_ACCESS_DENIED)
462467 ? L" Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings_settings.json! Access Denied."
@@ -479,7 +484,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
479484 {
480485 if ( ! CopyFile (defaultCfgPath, userCfgPath, FALSE ))
481486 {
482- if (PathFileExists (windowsTerminalDir)) {
487+ if (PathFileExists (windowsTerminalDir))
488+ {
483489 MessageBox (NULL ,
484490 (GetLastError () == ERROR_ACCESS_DENIED)
485491 ? L" Failed to copy vendor/windows-terminal_default_settings_settings.json file to [user specified path]/config/user_windows_terminal_settings.json! Access Denied."
@@ -622,7 +628,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
622628 // Try to find m'intty.exe' so ConEmu can launch using %MINTTY_EXE% in external Git for Cmder Mini.
623629 // See: https://github.com/Maximus5/ConEmu/issues/2559 for why this is commented.
624630
625- /*
631+ /*
626632 if (PathFileExists(vendoredGit))
627633 {
628634 PathCombine(minTTYPath, vendoredGit, L"usr\\bin\\mintty.exe");
@@ -852,6 +858,11 @@ cmderOptions GetOption()
852858 cmderOptions.cmderTask = szArgList[i + 1 ];
853859 i++;
854860 }
861+ else if ((_wcsicmp (L" bash" , szArgList[i]) == 0 || _wcsicmp (L" powershell" , szArgList[i]) == 0 ) || PathFileExists (windowsTerminalDir) || PathFileExists (conEmuDir))
862+ {
863+ cmderOptions.cmderTask = szArgList[i];
864+ i++;
865+ }
855866 else if (_wcsicmp (L" /title" , szArgList[i]) == 0 && !PathFileExists (windowsTerminalDir) && PathFileExists (conEmuDir))
856867 {
857868 cmderOptions.cmderTitle = szArgList[i + 1 ];
@@ -1010,4 +1021,4 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
10101021 }
10111022
10121023 return 0 ;
1013- }
1024+ }
0 commit comments