terminal: default render state foreground to white (#11736)

Fixes #11704

The RenderState empty initializer set both background and foreground to
the default RGB value of black (0, 0, 0), making text unreadable when a
caller has not explicitly configured terminal colors via DynamicRGB.
This is the common case for libghostty consumers.

Default the foreground to white so that the initial render state
provides readable white-on-black text out of the box.

Long term we also need to expose setting the default colors for a
Terminal instance but this is a workable fix in the mean time.
pull/11738/head
Mitchell Hashimoto 2026-03-21 20:30:32 -07:00 committed by GitHub
commit ad5e9679c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -98,8 +98,8 @@ pub const RenderState = struct {
.rows = 0,
.cols = 0,
.colors = .{
.background = .{},
.foreground = .{},
.background = .{ .r = 0, .g = 0, .b = 0 },
.foreground = .{ .r = 0xff, .g = 0xff, .b = 0xff },
.cursor = null,
.palette = color.default,
},