Repository: microsoft/terminal (language: cpp)

Issue:
Backups of settings.json?
I have 164 backups of settings.json going back to settings.json.2021-02-15T13-38-38.backup.  Is there no limit?  Thanks!


Discussion / hints:
Huh. No, there's no limit, but we might not need to be keeping those anymore. Those were more of a safety valve in the first few releases of the SUI, to make sure we didn't lose anything. 

Apparently, we didn't have a issue open to track getting rid of those, so _here it is_. 

Fix patch:
diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp
index 87a7ffdca8d..483f74c6cb6 100644
--- a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp
+++ b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp
@@ -894,12 +894,6 @@ void CascadiaSettings::WriteSettingsToDisk() const
 {
     const auto settingsPath = _settingsPath();
 
-    {
-        // create a timestamped backup file
-        const auto backupSettingsPath = fmt::format(L"{}.{:%Y-%m-%dT%H-%M-%S}.backup", settingsPath.native(), fmt::localtime(std::time(nullptr)));
-        LOG_IF_WIN32_BOOL_FALSE(CopyFileW(settingsPath.c_str(), backupSettingsPath.c_str(), TRUE));
-    }
-
     // write current settings to current settings file
     Json::StreamWriterBuilder wbuilder;
     wbuilder.settings_["indentation"] = "    ";


Test patch: