diff --git a/.github/actions/spelling/allow/names.txt b/.github/actions/spelling/allow/names.txt index 1b52d13a22a..6d6554c4a84 100644 --- a/.github/actions/spelling/allow/names.txt +++ b/.github/actions/spelling/allow/names.txt @@ -40,7 +40,7 @@ niksa nvaccess nvda osgwiki -Ottosson +ottosson pabhojwa Panos paulcam diff --git a/doc/theme_colors.html b/doc/theme_colors.html new file mode 100644 index 00000000000..880551a340d --- /dev/null +++ b/doc/theme_colors.html @@ -0,0 +1,736 @@ + + + + + + + Terminal Color Schemes + + + + + + +
+
+ + + + +
+
+ +
+ Add a scheme +
+ + + +
+
+ +
+
+ + + + + diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettings.h b/src/cascadia/TerminalSettingsModel/CascadiaSettings.h index cebf8174df3..57d6b33abc1 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettings.h +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettings.h @@ -72,7 +72,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation std::vector> profiles; std::unordered_map> profilesByGuid; std::unordered_map> colorSchemes; - std::unordered_map colorSchemeRemappings; bool fixupsAppliedDuringLoad{ false }; std::set themesChangeLog; @@ -100,6 +99,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation ParsedSettings inboxSettings; ParsedSettings userSettings; std::unordered_map> extensionPackageMap; + std::unordered_map colorSchemeRemappings; bool duplicateProfile = false; bool sshProfilesGenerated = false; diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp index af32e4e955f..857728659e6 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp @@ -605,7 +605,7 @@ bool winrt::Microsoft::Terminal::Settings::Model::implementation::SettingsLoader { if (auto schemeName{ appearance.LightColorSchemeName() }; !schemeName.empty()) { - if (auto found{ userSettings.colorSchemeRemappings.find(schemeName) }; found != userSettings.colorSchemeRemappings.end()) + if (auto found{ colorSchemeRemappings.find(schemeName) }; found != colorSchemeRemappings.end()) { appearance.LightColorSchemeName(found->second); modified = true; @@ -614,7 +614,7 @@ bool winrt::Microsoft::Terminal::Settings::Model::implementation::SettingsLoader if (auto schemeName{ appearance.DarkColorSchemeName() }; !schemeName.empty()) { - if (auto found{ userSettings.colorSchemeRemappings.find(schemeName) }; found != userSettings.colorSchemeRemappings.end()) + if (auto found{ colorSchemeRemappings.find(schemeName) }; found != colorSchemeRemappings.end()) { appearance.DarkColorSchemeName(found->second); modified = true; @@ -648,6 +648,15 @@ bool SettingsLoader::FixupUserSettings() std::wstring_view{ L"ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png" }, }; + // Terminal 1.26: "Ottosson" was replaced by "Ottosson Dark" and "Ottosson Light". + // Can be removed in ~1.28. + static winrt::param::hstring ottosson{ L"Ottosson" }; + static winrt::param::hstring ottossonDark{ L"Ottosson Dark" }; + if (!userSettings.colorSchemes.contains(ottosson)) + { + colorSchemeRemappings.emplace(ottosson, ottossonDark); + } + auto fixedUp = userSettings.fixupsAppliedDuringLoad; fixedUp = userSettings.globals->FixupsAppliedDuringLoad() || fixedUp; @@ -1154,7 +1163,7 @@ bool SettingsLoader::_addOrMergeUserColorScheme(const winrt::com_ptrName(newName); - userSettings.colorSchemeRemappings.emplace(newScheme->Name(), newName); + colorSchemeRemappings.emplace(newScheme->Name(), newName); // And re-add it to the end. userSettings.colorSchemes.emplace(newName, std::move(existingScheme)); return true; diff --git a/src/cascadia/TerminalSettingsModel/defaults.json b/src/cascadia/TerminalSettingsModel/defaults.json index 8971d3d3992..815a16a31a3 100644 --- a/src/cascadia/TerminalSettingsModel/defaults.json +++ b/src/cascadia/TerminalSettingsModel/defaults.json @@ -40,7 +40,6 @@ "name": "Windows PowerShell", "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png", - "colorScheme": "Campbell", "antialiasingMode": "grayscale", "closeOnExit": "automatic", "cursorShape": "bar", @@ -59,7 +58,6 @@ "name": "Command Prompt", "commandline": "%SystemRoot%\\System32\\cmd.exe", "icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png", - "colorScheme": "Campbell", "antialiasingMode": "grayscale", "closeOnExit": "automatic", "cursorShape": "bar", @@ -104,27 +102,50 @@ "brightWhite": "#DEE3E4" }, { - "name": "Ottosson", + "name": "Ottosson Dark", "background": "#000000", - "foreground": "#bebebe", - "cursorColor": "#ffffff", - "selectionBackground": "#92a4fd", + "foreground": "#CCCCCC", + "cursorColor": "#CCCCCC", + "selectionBackground": "#265574", "black": "#000000", - "red": "#be2c21", - "green": "#3fae3a", - "yellow": "#be9a4a", - "blue": "#204dbe", - "purple": "#bb54be", - "cyan": "#00a7b2", - "white": "#bebebe", - "brightBlack": "#808080", - "brightRed": "#ff3e30", - "brightGreen": "#58ea51", - "brightYellow": "#ffc944", - "brightBlue": "#2f6aff", - "brightPurple": "#fc74ff", - "brightCyan": "#00e1f0", - "brightWhite": "#ffffff" + "red": "#AE3527", + "green": "#009242", + "yellow": "#AE8A00", + "blue": "#465CAE", + "magenta": "#AE53A8", + "cyan": "#009BAE", + "white": "#CCCCCC", + "brightBlack": "#8A8A8A", + "brightRed": "#FF523F", + "brightGreen": "#00D865", + "brightYellow": "#FFCB00", + "brightBlue": "#6B8AFF", + "brightMagenta": "#FF7DF6", + "brightCyan": "#00E4FF", + "brightWhite": "#FFFFFF" + }, + { + "name": "Ottosson Light", + "background": "#FFFFFF", + "foreground": "#444444", + "cursorColor": "#444444", + "selectionBackground": "#ABD4F2", + "black": "#FFFFFF", + "red": "#5C0300", + "green": "#004B1E", + "yellow": "#5F4A00", + "blue": "#151580", + "magenta": "#680064", + "cyan": "#005763", + "white": "#444444", + "brightBlack": "#8D8D8D", + "brightRed": "#BB0C00", + "brightGreen": "#009A46", + "brightYellow": "#C19900", + "brightBlue": "#3435FF", + "brightMagenta": "#D100CB", + "brightCyan": "#00B2C8", + "brightWhite": "#000000" }, { "name": "Campbell",