ColorTool: parser bugfixes and small code refactor #624

Closed
opened 2026-01-30 21:57:17 +00:00 by claunia · 3 comments
Owner

Originally created by @waf on GitHub (Apr 21, 2019).

I'm using ColorTool as part of managing a theme for cmd / powershell, and I've run into a few issues using it:

  1. Error messages being thrown from parsers that are unused, e.g. the INI parser tries to run even if you are using itermcolors, so it throws errors because XML is not a valid INI file.
  2. Foreground / Background indexes aren't saved when using --defaults (or --both).

These are easy enough fixes and I'm happy to fix them. I was thinking of cleaning up the code a little bit while I'm there, namely:

  1. Allowing parsers to conditionally run, so not all parsers run for every file (should squelch some errors)
  2. Adding a common interface for "setting current console properties" and "console defaults," so it's harder to forget implementing functionality for either.

However, before I start working on this, I wanted to give you a heads-up, and make sure I wasn't working at cross-purposes with someone on the project. Would you be interested in a PR that fixes the above 2 points?

Thanks!

Originally created by @waf on GitHub (Apr 21, 2019). I'm using ColorTool as part of managing a theme for cmd / powershell, and I've run into a few issues using it: 1. Error messages being thrown from parsers that are unused, e.g. the INI parser tries to run even if you are using `itermcolors`, so it throws errors because XML is not a valid INI file. 2. Foreground / Background indexes aren't saved when using `--defaults` (or `--both`). These are easy enough fixes and I'm happy to fix them. I was thinking of cleaning up the code a little bit while I'm there, namely: 1. Allowing parsers to conditionally run, so not all parsers run for every file (should squelch some errors) 2. Adding a common interface for "setting current console properties" and "console defaults," so it's harder to forget implementing functionality for either. However, before I start working on this, I wanted to give you a heads-up, and make sure I wasn't working at cross-purposes with someone on the project. Would you be interested in a PR that fixes the above 2 points? Thanks!
claunia added the Product-ColortoolResolution-Fix-AvailableArea-SettingsIssue-Bug labels 2026-01-30 21:57:17 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 21, 2019):

@waf, that would be a very welcome change. Nobody on our side is currently working on either of those.

@DHowett-MSFT commented on GitHub (Apr 21, 2019): @waf, that would be a very welcome change. Nobody on our side is currently working on either of those.
Author
Owner

@waf commented on GitHub (Apr 25, 2019):

@DHowett-MSFT thanks, I've opened #418 for this.

@waf commented on GitHub (Apr 25, 2019): @DHowett-MSFT thanks, I've opened #418 for this.
Author
Owner

@miniksa commented on GitHub (May 18, 2019):

I believe this is now available in the release I made a few weeks ago.

@miniksa commented on GitHub (May 18, 2019): I believe this is now available in the release I made a few weeks ago.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#624