Fix invisible default-styled text on Linux framebuffer TTY#303
Merged
Conversation
`ghostel--face-hex-color' only treated the literal "unspecified" string as unset, so on a TTY frame where the default face reports the sentinel strings "unspecified-fg" / "unspecified-bg" it fell through to the "#000000" fallback for both attributes. The pair was then handed to both `ghostel--set-default-colors' (telling libghostty the terminal's default fg AND bg are black) and `ghostel--set-buffer-face' (remapping the buffer's default face black-on-black), making any default-styled cell invisible. Recognize all three sentinel strings and split the last-resort fallback into white for :foreground and black for :background so fg and bg can never collapse to the same hex. Fixes #297
bdcab66 to
fb07ea8
Compare
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.
Summary
Closes #297.
On a Linux framebuffer TTY the
defaultface reports the sentinel strings"unspecified-fg"/"unspecified-bg"rather than a real color.ghostel--face-hex-coloronly filtered the literal"unspecified", so it fell through to the"#000000"fallback for both attributes. That pair was then handed to:ghostel--set-default-colors— libghostty was told the terminal's default fg AND bg are black.ghostel--set-buffer-face— the buffer'sdefaultface was remapped black-on-black.Result: any cell rendered with default styling (everything typed at the prompt, Claude Code output, prompts that don't set explicit colors) was black-on-black and invisible.
The fix recognizes all three sentinel strings (
"unspecified","unspecified-fg","unspecified-bg") and splits the last-resort fallback so:foregrounddefaults to#ffffffand:backgroundto#000000— they can no longer collapse to the same hex.Test plan
make -j8 all— build, all elisp + native + evil tests, byte-compile, package-lint, checkdoc all pass.ghostel-test-face-hex-color-tty-unspecifiedintest/ghostel-render-test.elmocksface-attributewith the TTY sentinels and asserts the resolved fg/bg are both valid#RRGGBBand differ.