fix: use lowercased key when validating windowsterminal.profileTemplate#40911
Open
Osamaali313 wants to merge 1 commit into
Open
fix: use lowercased key when validating windowsterminal.profileTemplate#40911Osamaali313 wants to merge 1 commit into
Osamaali313 wants to merge 1 commit into
Conversation
read_config_keys lowercases option names (line 198: key.lower()), so the stored key is 'windowsterminal.profiletemplate'. The validation block looked it up as 'windowsterminal.profileTemplate' (camelCase), which never matches, so the terminal profile template's mode/size/location checks silently never ran. Every other config.get() in this function and the valid-keys list already use the lowercase form. Look up the lowercase key so the validation block executes.
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.
Problem
read_config_keyslowercases option names when building its key dict:So a
[windowsterminal]section withprofileTemplate = ...is stored underwindowsterminal.profiletemplate. But the validation block looks it up with the camelCase key:dict.getis case-sensitive, so this always returnsNoneand the block never runs — the terminal profile template file's mode/size/location checks are silently skipped for every distribution validated. The valid-keys list (line 433) and every otherconfig.get(...)in this function already use the lowercase form (oobe.command,shortcut.icon,windowsterminal.profiletemplate, …); line 455 was the lone outlier.Reproduction
Using the real
read_config_keyson the canonical config ([windowsterminal]/profileTemplate = /usr/lib/wsl/terminal.json, as written in the repo's own tests):Fix
Look up the lowercase key at line 455 so the validation block executes. One-character change; behavior of all other keys is unchanged.