Skip to content

fix(lexers): recognize equals after SSH Host and Match directives - #1510

Merged
github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/ssh-selector-assignment-nov19
Nov 19, 2026
Merged

github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/ssh-selector-assignment-nov19

Conversation

@yxshee

@yxshee yxshee commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

OpenSSH treats both these lines as selectors. Chroma treats them as ordinary configuration options if an equals sign directly follows the keyword.

Host=*.example.invalid
Match=host *.example.invalid

With the base lexer, Host is lexed as NameBuiltin and the wildcard as LiteralString. Accept an equals sign in the existing selector rules so the wildcard and match criteria get their usual highlighting.

The regression fixture fails before the patch and passes after. All 336 test configurations were checked with ssh -G. Chroma now highlights each selector like the equivalent space-delimited form. The tests, lint and generated-code check all pass.

@github-actions
github-actions Bot enabled auto-merge (squash) November 19, 2026 10:11
@github-actions
github-actions Bot merged commit e740ad4 into alecthomas:master Nov 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant