Skip to content

Fix invisible default-styled text on Linux framebuffer TTY#303

Merged
dakra merged 1 commit into
mainfrom
fix/tty-default-color-invisible-text
May 21, 2026
Merged

Fix invisible default-styled text on Linux framebuffer TTY#303
dakra merged 1 commit into
mainfrom
fix/tty-default-color-invisible-text

Conversation

@dakra
Copy link
Copy Markdown
Owner

@dakra dakra commented May 21, 2026

Summary

Closes #297.

On a Linux framebuffer TTY the default face reports the sentinel strings "unspecified-fg" / "unspecified-bg" rather than a real color. ghostel--face-hex-color only 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's default face 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 :foreground defaults to #ffffff and :background to #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.
  • New regression test ghostel-test-face-hex-color-tty-unspecified in test/ghostel-render-test.el mocks face-attribute with the TTY sentinels and asserts the resolved fg/bg are both valid #RRGGBB and differ.
  • Manual confirmation in an actual Linux framebuffer TTY by the issue reporter (not reproducible in CI).

`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
@dakra dakra force-pushed the fix/tty-default-color-invisible-text branch from bdcab66 to fb07ea8 Compare May 21, 2026 06:31
@dakra dakra merged commit fb07ea8 into main May 21, 2026
22 checks passed
@dakra dakra deleted the fix/tty-default-color-invisible-text branch May 21, 2026 06:34
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.

In Linux TTY framebuffer the text I type is invisible

1 participant