You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (wcscmp(cpuCfgPath, L"") ==0 && (PathFileExists(cpuCfgPath) || use_user_cfg == false)) // config/ConEmu-%COMPUTERNAME%.xml file exists or /m was specified on command line, use machine specific config.
292
+
293
+
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.
294
294
{
295
295
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
296
296
{
297
-
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
297
+
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
298
298
{
299
-
if (PathFileExists(windowsTerminalDir)) {
300
-
MessageBox(NULL,
301
-
(GetLastError() == ERROR_ACCESS_DENIED)
302
-
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
303
-
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
304
-
exit(1);
305
-
}
306
-
elseif (PathFileExists(conEmuDir))
299
+
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
307
300
{
308
-
MessageBox(NULL,
309
-
(GetLastError() == ERROR_ACCESS_DENIED)
310
-
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
311
-
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
312
-
exit(1);
301
+
if (PathFileExists(windowsTerminalDir)) {
302
+
MessageBox(NULL,
303
+
(GetLastError() == ERROR_ACCESS_DENIED)
304
+
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
305
+
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
306
+
exit(1);
307
+
}
308
+
elseif (PathFileExists(conEmuDir))
309
+
{
310
+
MessageBox(NULL,
311
+
(GetLastError() == ERROR_ACCESS_DENIED)
312
+
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
313
+
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
314
+
exit(1);
315
+
}
313
316
}
314
317
}
315
-
}
316
-
else// vendor/conemu-maximus5/ConEmu.xml config file does not exist, copy config/ConEmu-%COMPUTERNAME%.xml to vendor/conemu-maximus5/ConEmu.xml file
317
-
{
318
-
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
318
+
else// [terminal emulator config] file does not exist, copy config/[host specific terminal emulator config] file to [terminal emulator config] file
319
319
{
320
-
if (PathFileExists(windowsTerminalDir)) {
321
-
MessageBox(NULL,
322
-
(GetLastError() == ERROR_ACCESS_DENIED)
323
-
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
324
-
: L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json!", MB_TITLE, MB_ICONSTOP);
325
-
exit(1);
326
-
}
327
-
elseif (PathFileExists(conEmuDir))
320
+
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
328
321
{
329
-
MessageBox(NULL,
330
-
(GetLastError() == ERROR_ACCESS_DENIED)
331
-
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
332
-
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
333
-
exit(1);
322
+
if (PathFileExists(windowsTerminalDir)) {
323
+
MessageBox(NULL,
324
+
(GetLastError() == ERROR_ACCESS_DENIED)
325
+
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
326
+
: L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json!", MB_TITLE, MB_ICONSTOP);
327
+
exit(1);
328
+
}
329
+
elseif (PathFileExists(conEmuDir))
330
+
{
331
+
MessageBox(NULL,
332
+
(GetLastError() == ERROR_ACCESS_DENIED)
333
+
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
334
+
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
335
+
exit(1);
336
+
}
334
337
}
335
338
}
336
339
}
337
340
}
338
-
elseif (wcscmp(userCfgPath, L"") ==0 && PathFileExists(userCfgPath)) // config/user_conemu.xml exists, use it.
341
+
elseif (wcscmp(userCfgPath, L"") !=0 && PathFileExists(userCfgPath)) // config/user[terminal emulator config] file exists, use it.
339
342
{
340
343
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
341
344
{
342
-
if (PathFileExists(cfgPath)) //vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml.
345
+
if (PathFileExists(cfgPath)) //[terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
elseif (wcscmp(cfgPath, L"") !=0 && PathFileExists(cfgPath)) //This is a first time Cmder.exe run and [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
0 commit comments