[PR #2651] [MERGED] Prevent the v1 propsheet from zeroing colors, causing black text on black background. #25011

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/2651
Author: @zadjii-msft
Created: 9/3/2019
Status: Merged
Merged: 10/3/2019
Merged by: @carlos-zamora

Base: masterHead: dev/migrie/b/2319-v1-propsheet-zeros-colors


📝 Commits (6)

  • 3d95ee8 This fixes the registry path
  • a6cccea Fix the shortcut loading too
  • 18e11c6 Merge remote-tracking branch 'origin/master' into dev/migrie/b/2319-v1-propsheet-zeros-colors
  • 279083e Merge branch 'master' into dev/migrie/b/2319-v1-propsheet-zeros-colors
  • 842262f remove the redundant property I added
  • 1b054ff add some notes to the bx.ps1 change

📊 Changes

9 files changed (+106 additions, -60 deletions)

View changed files

📝 src/propsheet/PropSheetHandler.cpp (+6 -0)
📝 src/propsheet/console.cpp (+4 -1)
📝 src/propsheet/console.h (+2 -0)
📝 src/propsheet/globals.cpp (+3 -0)
📝 src/propsheet/registry.cpp (+50 -43)
📝 src/propslib/ShortcutSerialization.cpp (+25 -13)
📝 src/propslib/ShortcutSerialization.hpp (+1 -1)
📝 tools/bx.ps1 (+14 -2)
📝 tools/opencon.cmd (+1 -0)

📄 Description

Summary of the Pull Request

The v1 console doesn't know anything about "default foreground" or "default background" colors. So when the v1 console starts up, it leaves those members of the CONSOLE_STATE_INFO zero'd. However, both the v1 and v2 console's share the same console.dll, the propsheet. When the user unchecks the "use legacy settings" checkbox and saves the settings, the propsheet tries to save the v2 settings that are totally inaccessible to the "v1" propsheet, and were zero'd to match the state of the console.

This change makes is so that the propsheet only saves the "Terminal" settings when the propsheet was launched from a v2 console.

PR Checklist

Detailed Description of the Pull Request / Additional comments

This PR fixes the bug for both loading the settings from the registry and loading from the shortcut.

Validation Steps Performed

  1. Copied my modified console.dll into system32.
  2. Opened a v2 conhost from win+r, cmd (using the registry settings)
  3. opened the propsheet, confirmed it had a default FG/BG.
  4. Used the propsheet to switch to legacy mode
  5. Opened a v1 conhost with win+r
  6. Opened the propsheet, confirmed there was no "Terminal" propsheet
  7. unchecked the "legacy" checkbox
  8. Opened a new win+r conhost
  9. It re-opened with the original default colors

and then repeat steps 2-9 using the Win+X, C conhost, which uses a shortcut instead of the registry.


🔄 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/2651 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 9/3/2019 **Status:** ✅ Merged **Merged:** 10/3/2019 **Merged by:** [@carlos-zamora](https://github.com/carlos-zamora) **Base:** `master` ← **Head:** `dev/migrie/b/2319-v1-propsheet-zeros-colors` --- ### 📝 Commits (6) - [`3d95ee8`](https://github.com/microsoft/terminal/commit/3d95ee81352e2dc7dda49fcb03992bcc6fd31786) This fixes the registry path - [`a6cccea`](https://github.com/microsoft/terminal/commit/a6cccea7e05ae5baa4a8f26edc093df1f352ca14) Fix the shortcut loading too - [`18e11c6`](https://github.com/microsoft/terminal/commit/18e11c6c131cccbc5e51531bfbb060b2d56dc13e) Merge remote-tracking branch 'origin/master' into dev/migrie/b/2319-v1-propsheet-zeros-colors - [`279083e`](https://github.com/microsoft/terminal/commit/279083e723fdfbb9fb952267b7bbe6bd8354c7f7) Merge branch 'master' into dev/migrie/b/2319-v1-propsheet-zeros-colors - [`842262f`](https://github.com/microsoft/terminal/commit/842262f997f959e5662b6a0bf7970447811415a5) remove the redundant property I added - [`1b054ff`](https://github.com/microsoft/terminal/commit/1b054ff391f0486625a4e8b8ce1b9f8fe7924bcf) add some notes to the bx.ps1 change ### 📊 Changes **9 files changed** (+106 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `src/propsheet/PropSheetHandler.cpp` (+6 -0) 📝 `src/propsheet/console.cpp` (+4 -1) 📝 `src/propsheet/console.h` (+2 -0) 📝 `src/propsheet/globals.cpp` (+3 -0) 📝 `src/propsheet/registry.cpp` (+50 -43) 📝 `src/propslib/ShortcutSerialization.cpp` (+25 -13) 📝 `src/propslib/ShortcutSerialization.hpp` (+1 -1) 📝 `tools/bx.ps1` (+14 -2) 📝 `tools/opencon.cmd` (+1 -0) </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)? --> ## Summary of the Pull Request The v1 console doesn't know anything about "default foreground" or "default background" colors. So when the v1 console starts up, it leaves those members of the `CONSOLE_STATE_INFO` zero'd. However, both the v1 and v2 console's share the same `console.dll`, the propsheet. When the user unchecks the "use legacy settings" checkbox and saves the settings, the propsheet tries to save the v2 settings that are totally inaccessible to the "v1" propsheet, and were zero'd to match the state of the console. This change makes is so that the propsheet only saves the "Terminal" settings when the propsheet was launched from a v2 console. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #2319 * [x] I work here * [n/a] Tests added/passed * [n/a] Requires documentation to be updated <!-- 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 This PR fixes the bug for both loading the settings from the registry _and_ loading from the shortcut. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed 1. Copied my modified console.dll into system32. 2. Opened a v2 conhost from win+r, `cmd` (using the registry settings) 3. opened the propsheet, confirmed it had a default FG/BG. 4. Used the propsheet to switch to legacy mode 5. Opened a v1 conhost with win+r 6. Opened the propsheet, confirmed there was no "Terminal" propsheet 7. unchecked the "legacy" checkbox 8. Opened a new win+r conhost 9. It re-opened with the original default colors and then repeat steps 2-9 using the Win+X, C conhost, which uses a shortcut instead of the registry. --- <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:06:42 +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#25011