Skip to content

Fix GhosttyCore scrollback cells rendering with black colors#66

Open
hobostay wants to merge 1 commit intovercel-labs:mainfrom
hobostay:fix/ghostty-scrollback-colors
Open

Fix GhosttyCore scrollback cells rendering with black colors#66
hobostay wants to merge 1 commit intovercel-labs:mainfrom
hobostay:fix/ghostty-scrollback-colors

Conversation

@hobostay
Copy link
Copy Markdown

@hobostay hobostay commented May 5, 2026

Summary

  • Fix getScrollbackCell() in @wterm/ghostty unconditionally packing RGB values into fgRgb/bgRgb even when colorFlags indicates no explicit color was set
  • This caused scrollback lines to always render with rgb(0,0,0) (black) foreground/background instead of using terminal default colors
  • Now matches the same colorFlags check pattern used by getCell()

Before

return {
  char: cell.codepoint || 32,
  fg: DEFAULT_COLOR, bg: DEFAULT_COLOR,
  flags: cell.flags,
  fgRgb: packRgb(cell.fgR, cell.fgG, cell.fgB), // always set → black
  bgRgb: packRgb(cell.bgR, cell.bgG, cell.bgB), // always set → black
};

After

const result = { char: cell.codepoint || 32, fg: DEFAULT_COLOR, bg: DEFAULT_COLOR, flags: cell.flags };
if (cell.colorFlags & 1) result.fgRgb = packRgb(...);
if (cell.colorFlags & 2) result.bgRgb = packRgb(...);
return result;

Test plan

  • Verify scrollback lines in Ghostty core render with correct colors instead of black
  • Compare scrollback rendering with viewport rendering — colors should match

🤖 Generated with Claude Code

getScrollbackCell() unconditionally packed RGB values into fgRgb/bgRgb
even when colorFlags indicated no explicit color was set. This caused
scrollback lines to render with rgb(0,0,0) instead of using terminal
default colors. Now matches getCell()'s logic by checking colorFlags
before setting fgRgb/bgRgb.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

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