Fix tab color being lost when OS switches from light to dark mode#627
Open
schneidermayer wants to merge 1 commit intognachman:masterfrom
Open
Fix tab color being lost when OS switches from light to dark mode#627schneidermayer wants to merge 1 commit intognachman:masterfrom
schneidermayer wants to merge 1 commit intognachman:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a small but annoying tab-color bug.
If a session tab color is set while OS is in Light mode, and the profile uses
Use separate colors for light and dark mode, switching macOS to Dark mode can make the tab color disappear. Switching back to Light brings it back.This is pretty annoying. I have 10+ tabs color coded, and when sun sets, I lose all my colors and have to manually set them again.
The root cause was an asymmetry between the write and read paths. The tab color was written only to the active appearance variant, but later read only from the current variant and then the shared unsuffixed key. For session-specific overrides, that shared key is usually unset.
This change keeps the fix scoped to tab colors. Tab-color reads now try:
(→ This mechanic still allows different tab colors for both OS themes. Personally, I think one global Tab color would cover the use cases and simplify things. I just was not confident to decide this on myself, so the fix leaves the core principle untouched. Maybe @gnachman has an opinion, if one global Tab color is even better? :-))
Testing
I also added focused regression tests for the tab-color resolver logic.