You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ghostty): preserve literal hashes in unquoted config values - #52756
Ghostty config syntax only treats whole-line # prefixes as comments — inline # comments are not supported. parseGhosttyConfig previously stripped whitespace-prefixed # suffixes via stripInlineComment(), which truncated unquoted values such as theme file paths containing #.
What Changed
src/main/ghostty/parser.ts: removed stripInlineComment() while keeping whole-line # comment handling and quote stripping intact.
src/main/ghostty/parser.test.ts: added a parser regression test verifying literal # preservation in unquoted values alongside whole-line comments and hex colors.
Performance
None — removes a character-by-character scan per config line.
Verification
pnpm check:changed --base=origin/main: all 27 checks passed (including src/main/ghostty/parser.test.ts and palette-index-import.test.ts).
No actionable comments were generated in the recent review.
Walkthrough
parseGhosttyConfig continues to skip whole-line comments and now preserves hash characters in configuration values, including hashes after whitespace. A new test covers indented comments and hash-containing values.
Severity of issue fixed: Low
Merge Risk: Minimal · up to b84ff
Ghostty config values that contain a literal hash, such as theme paths, are now preserved instead of truncated. No concrete merge risk remains.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Description check
The description covers the main template sections. It has a Summary that explains the mechanism and links issue #50540, a What Changed section listing both files, a Performance answer, and a Verificat…
Add the missing template sections: an ELI5 summary, a Why section explaining why removing inline-comment stripping beats the alternatives, and a Visual Proof entry (write N/A with a reason, since this is a parser change). Add a Risk secti…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title names the main change: unquoted Ghostty config values now keep literal # characters. The raw summary confirms parseGhosttyConfig stops stripping inline comments, and the fix is scoped to…
Linked Issues check
[#50540] requires that unquoted Ghostty values keep a literal # and that whole-line comments stay ignored. The diff removes stripInlineComment() from src/main/ghostty/parser.ts and the value i…
Out of Scope Changes check
All changes map to [#50540]. The parser change removes the inline-comment helper and its call. A comment line documents the new behavior. The added test covers the changed parsing behavior. No unrelat…
Full details: Title check
Explanation
The title names the main change: unquoted Ghostty config values now keep literal # characters. The raw summary confirms parseGhosttyConfig stops stripping inline comments, and the fix is scoped to the ghostty parser. The fix(ghostty): prefix follows a conventional format and is specific enough for a reviewer scanning history.
Full details: Linked Issues check
Explanation
[#50540] requires that unquoted Ghostty values keep a literal # and that whole-line comments stay ignored. The diff removes stripInlineComment() from src/main/ghostty/parser.ts and the value is no longer truncated at the whitespace-prefixed #. Whole-line comment handling and quote stripping remain. The new test in src/main/ghostty/parser.test.ts checks that theme = /tmp/themes/my # dark theme parses intact, that indented and unindented whole-line comments are ignored, and that font-size and a hex background still parse. Gap: the issue reproduction also runs the value through the existing real-file theme resolver and expects background/foreground colors. The PR test covers parser output only and does not exercise theme resolution. The core parser requirement is met. The resolver path is not covered by a test in this PR.
Full details: Out of Scope Changes check
Explanation
All changes map to [#50540]. The parser change removes the inline-comment helper and its call. A comment line documents the new behavior. The added test covers the changed parsing behavior. No unrelated files or behavior changes appear in the whole-PR diff against the merge base. Related issues #37353 and #7126 are context only and are not implemented here.
Full details: Description check
Explanation
The description covers the main template sections. It has a Summary that explains the mechanism and links issue #50540, a What Changed section listing both files, a Performance answer, and a Verification section. It omits the template's ELI5, Why (alternatives considered), Visual Proof (N/A with reason), and Risk sections, and it leaves the Testing checkboxes unchecked. It also does not state the risk level or a revert plan.
Resolution
Add the missing template sections: an ELI5 summary, a Why section explaining why removing inline-comment stripping beats the alternatives, and a Visual Proof entry (write N/A with a reason, since this is a parser change). Add a Risk section with a Level (for example Low) and a rollback plan (a plain revert). Check the Testing boxes that apply, and state which platforms were tested. The author reported Linux testing in the linked issue, so name that platform in the Testing section. Complete the Performance line with the full sentence, for example: None, because this only runs when a config file is parsed.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ca4d9f4a-d3f8-49f7-ae13-ee9348c974e9
Commits
Reviewing files that changed from the base of the PR and between 9b27fdb and b84ff2e.
Files selected for processing: 2
src/main/ghostty/parser.test.ts
src/main/ghostty/parser.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
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
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.
Summary
Fixes #50540.
Ghostty config syntax only treats whole-line
#prefixes as comments — inline#comments are not supported.parseGhosttyConfigpreviously stripped whitespace-prefixed#suffixes viastripInlineComment(), which truncated unquoted values such as theme file paths containing#.What Changed
src/main/ghostty/parser.ts: removedstripInlineComment()while keeping whole-line#comment handling and quote stripping intact.src/main/ghostty/parser.test.ts: added a parser regression test verifying literal#preservation in unquoted values alongside whole-line comments and hex colors.Performance
None — removes a character-by-character scan per config line.
Verification
pnpm check:changed --base=origin/main: all 27 checks passed (includingsrc/main/ghostty/parser.test.tsandpalette-index-import.test.ts).