[PR #418] [MERGED] Fix ColorTool parser and registry bugs, and refactor #24122

Open
opened 2026-01-31 09:01:31 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/418
Author: @waf
Created: 4/25/2019
Status: Merged
Merged: 4/29/2019
Merged by: @miniksa

Base: masterHead: fix-parser-and-registry-bugs-with-refactor


📝 Commits (5)

  • 7daea0a pull logic out of Program.cs
  • 05f518d replace mutable public fields with properties
  • b61cb83 allow scheme parsers to opt out of attempting to parse a file
  • 12fff31 add support for writing foreground / background indices to registry
  • f8f4f26 standardize casing on PascalCase

📊 Changes

17 files changed (+883 additions, -774 deletions)

View changed files

📝 tools/ColorTool/ColorTool/ColorScheme.cs (+58 -18)
tools/ColorTool/ColorTool/ColorTable.cs (+205 -0)
📝 tools/ColorTool/ColorTool/ColorTool.csproj (+2 -1)
📝 tools/ColorTool/ColorTool/ConsoleAPI.cs (+6 -7)
📝 tools/ColorTool/ColorTool/ConsoleAttributes.cs (+16 -7)
tools/ColorTool/ColorTool/ConsoleTargets/CurrentConsoleTarget.cs (+47 -0)
tools/ColorTool/ColorTool/ConsoleTargets/DefaultConsoleTarget.cs (+36 -0)
tools/ColorTool/ColorTool/ConsoleTargets/IConsoleTarget.cs (+15 -0)
tools/ColorTool/ColorTool/ConsoleTargets/VirtualTerminalConsoleTarget.cs (+69 -0)
📝 tools/ColorTool/ColorTool/Program.cs (+48 -510)
tools/ColorTool/ColorTool/Scheme.cs (+0 -41)
tools/ColorTool/ColorTool/SchemeManager.cs (+106 -0)
📝 tools/ColorTool/ColorTool/SchemeParsers/ISchemeParser.cs (+3 -3)
📝 tools/ColorTool/ColorTool/SchemeParsers/IniSchemeParser.cs (+60 -54)
📝 tools/ColorTool/ColorTool/SchemeParsers/JsonParser.cs (+67 -59)
📝 tools/ColorTool/ColorTool/SchemeParsers/XmlSchemeParser.cs (+79 -74)
tools/ColorTool/ColorTool/SchemeWriters/IniSchemeWriter.cs (+66 -0)

📄 Description

This is the PR we discussed in https://github.com/Microsoft/console/issues/413 for ColorTool. There are two bugfixes in this PR (the final two commits). The first two commits are the refactoring.

  • 7daea0a - First refactoring commit, pulls logic out of Program.cs and into other files.
  • 05f518d - Second refactoring commit, gets rid of mutable fields and mutable statics.
  • b61cb830 - Only run the required parser for the colorscheme file. Before, all parsers could be run for a single colorscheme file, so we could get error output even if everything imported correctly.
  • 12fff31 - Allow the writing of screen/popup background/foreground indices to the registry. Before this only worked for the currently running console, now it will save for all consoles.

This PR modifies a lot of files, but I've isolated the bulk of the changes in the first commits, so there are no user-facing changes in those commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/418 **Author:** [@waf](https://github.com/waf) **Created:** 4/25/2019 **Status:** ✅ Merged **Merged:** 4/29/2019 **Merged by:** [@miniksa](https://github.com/miniksa) **Base:** `master` ← **Head:** `fix-parser-and-registry-bugs-with-refactor` --- ### 📝 Commits (5) - [`7daea0a`](https://github.com/microsoft/terminal/commit/7daea0a25c3cf954485abd47803e1c8bf6bdd6ef) pull logic out of Program.cs - [`05f518d`](https://github.com/microsoft/terminal/commit/05f518db5bf20eb49c294c87396f81d7579e56bd) replace mutable public fields with properties - [`b61cb83`](https://github.com/microsoft/terminal/commit/b61cb830c3a2110037c645fbb57f7345d703b86b) allow scheme parsers to opt out of attempting to parse a file - [`12fff31`](https://github.com/microsoft/terminal/commit/12fff3126be6c41bc6a1b124c4a3085c5eb01925) add support for writing foreground / background indices to registry - [`f8f4f26`](https://github.com/microsoft/terminal/commit/f8f4f263a527cea45b897e43667a528335e0f3f7) standardize casing on PascalCase ### 📊 Changes **17 files changed** (+883 additions, -774 deletions) <details> <summary>View changed files</summary> 📝 `tools/ColorTool/ColorTool/ColorScheme.cs` (+58 -18) ➕ `tools/ColorTool/ColorTool/ColorTable.cs` (+205 -0) 📝 `tools/ColorTool/ColorTool/ColorTool.csproj` (+2 -1) 📝 `tools/ColorTool/ColorTool/ConsoleAPI.cs` (+6 -7) 📝 `tools/ColorTool/ColorTool/ConsoleAttributes.cs` (+16 -7) ➕ `tools/ColorTool/ColorTool/ConsoleTargets/CurrentConsoleTarget.cs` (+47 -0) ➕ `tools/ColorTool/ColorTool/ConsoleTargets/DefaultConsoleTarget.cs` (+36 -0) ➕ `tools/ColorTool/ColorTool/ConsoleTargets/IConsoleTarget.cs` (+15 -0) ➕ `tools/ColorTool/ColorTool/ConsoleTargets/VirtualTerminalConsoleTarget.cs` (+69 -0) 📝 `tools/ColorTool/ColorTool/Program.cs` (+48 -510) ➖ `tools/ColorTool/ColorTool/Scheme.cs` (+0 -41) ➕ `tools/ColorTool/ColorTool/SchemeManager.cs` (+106 -0) 📝 `tools/ColorTool/ColorTool/SchemeParsers/ISchemeParser.cs` (+3 -3) 📝 `tools/ColorTool/ColorTool/SchemeParsers/IniSchemeParser.cs` (+60 -54) 📝 `tools/ColorTool/ColorTool/SchemeParsers/JsonParser.cs` (+67 -59) 📝 `tools/ColorTool/ColorTool/SchemeParsers/XmlSchemeParser.cs` (+79 -74) ➕ `tools/ColorTool/ColorTool/SchemeWriters/IniSchemeWriter.cs` (+66 -0) </details> ### 📄 Description This is the PR we discussed in https://github.com/Microsoft/console/issues/413 for ColorTool. There are two bugfixes in this PR (the final two commits). The first two commits are the refactoring. - 7daea0a - First refactoring commit, pulls logic out of Program.cs and into other files. - 05f518d - Second refactoring commit, gets rid of mutable fields and mutable statics. - b61cb830 - Only run the required parser for the colorscheme file. Before, all parsers could be run for a single colorscheme file, so we could get error output even if everything imported correctly. - 12fff31 - Allow the writing of screen/popup background/foreground indices to the registry. Before this only worked for the currently running console, now it will save for all consoles. This PR modifies a lot of files, but I've isolated the bulk of the changes in the first commits, so there are no user-facing changes in those commits. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:01:31 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#24122