[PR #1052] [MERGED] Add feature to ColorTool to write color scheme as JSON for Windows Terminal (issue #986) #24457

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/1052
Author: @DJackman123
Created: 5/29/2019
Status: ✅ Merged
Merged: 6/25/2019
Merged by: @adiviness

Base: master ← Head: TerminalSupportForColorTool


📝 Commits (3)

  • 1a6d344 Add a new console target that writes the color scheme to stdout in JSON format for copying into a Windows Terminal profiles.json file.
  • aa88c90 Update src/tools/ColorTool/ColorTool/ConsoleTargets/TerminalSchemeConsoleTarget.cs
  • db8d4ec Create a base class for scheme parsers for common code and helpers. Fix string formatting according to review comments.

📊 Changes

8 files changed (+123 additions, -22 deletions)

View changed files

📝 src/tools/ColorTool/ColorTool/ColorScheme.cs (+3 -1)
➕ src/tools/ColorTool/ColorTool/ConsoleTargets/TerminalSchemeConsoleTarget.cs (+59 -0)
📝 src/tools/ColorTool/ColorTool/Program.cs (+10 -0)
📝 src/tools/ColorTool/ColorTool/Resources.resx (+1 -0)
📝 src/tools/ColorTool/ColorTool/SchemeParsers/IniSchemeParser.cs (+7 -7)
📝 src/tools/ColorTool/ColorTool/SchemeParsers/JsonParser.cs (+7 -7)
➕ src/tools/ColorTool/ColorTool/SchemeParsers/SchemeParserBase.cs (+28 -0)
📝 src/tools/ColorTool/ColorTool/SchemeParsers/XmlSchemeParser.cs (+8 -7)

📄 Description

Adds to ColorTool a new console target that writes the color scheme to stdout in JSON format suitable for copy/pasting into a Windows Terminal profiles.json file.
I didn't see any unit tests for ColorTool, so I only tested this manually with itermcolors files.

References

PR Checklist

  • Closes Draw shadows around glyphs (#986)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #986

Detailed Description of the Pull Request / Additional comments


🔄 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/1052 **Author:** [@DJackman123](https://github.com/DJackman123) **Created:** 5/29/2019 **Status:** ✅ Merged **Merged:** 6/25/2019 **Merged by:** [@adiviness](https://github.com/adiviness) **Base:** `master` ← **Head:** `TerminalSupportForColorTool` --- ### 📝 Commits (3) - [`1a6d344`](https://github.com/microsoft/terminal/commit/1a6d344abf811874534babc0a24eb8a1c91394a8) Add a new console target that writes the color scheme to stdout in JSON format for copying into a Windows Terminal profiles.json file. - [`aa88c90`](https://github.com/microsoft/terminal/commit/aa88c9014e0a9332dd80434ab1f308cbc9ab89ee) Update src/tools/ColorTool/ColorTool/ConsoleTargets/TerminalSchemeConsoleTarget.cs - [`db8d4ec`](https://github.com/microsoft/terminal/commit/db8d4ec279a14c56c85babed9fc7a7508ded0df1) Create a base class for scheme parsers for common code and helpers. Fix string formatting according to review comments. ### 📊 Changes **8 files changed** (+123 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/tools/ColorTool/ColorTool/ColorScheme.cs` (+3 -1) ➕ `src/tools/ColorTool/ColorTool/ConsoleTargets/TerminalSchemeConsoleTarget.cs` (+59 -0) 📝 `src/tools/ColorTool/ColorTool/Program.cs` (+10 -0) 📝 `src/tools/ColorTool/ColorTool/Resources.resx` (+1 -0) 📝 `src/tools/ColorTool/ColorTool/SchemeParsers/IniSchemeParser.cs` (+7 -7) 📝 `src/tools/ColorTool/ColorTool/SchemeParsers/JsonParser.cs` (+7 -7) ➕ `src/tools/ColorTool/ColorTool/SchemeParsers/SchemeParserBase.cs` (+28 -0) 📝 `src/tools/ColorTool/ColorTool/SchemeParsers/XmlSchemeParser.cs` (+8 -7) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> Adds to ColorTool a new console target that writes the color scheme to stdout in JSON format suitable for copy/pasting into a Windows Terminal profiles.json file. I didn't see any unit tests for ColorTool, so I only tested this manually with itermcolors files. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #986 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #986 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments --- <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:03:26 +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#24457