Skip to content

feat: powerline and block character rendering with visual tests#128

Open
slang25 wants to merge 3 commits into
coder:mainfrom
slang25:slang25/powerline-render-tests
Open

feat: powerline and block character rendering with visual tests#128
slang25 wants to merge 3 commits into
coder:mainfrom
slang25:slang25/powerline-render-tests

Conversation

@slang25
Copy link
Copy Markdown
Contributor

@slang25 slang25 commented Feb 21, 2026

Summary

Port of powerline and block character rendering from fork, with a complete visual regression test suite.

  • Pixel-perfect block characters (U+2580-U+259F) rendered as rectangles for gap-free ASCII art
  • Powerline glyphs (U+E0B0-U+E0BF) rendered as vector shapes for exact cell height matching
  • Font metrics improvements using fontBoundingBox for better coverage of special glyphs
  • 15 visual regression tests covering text, colors, cursors, wide characters, and special glyphs
  • Headless Puppeteer test runner with baseline image comparison for CI/CD integration

All visual tests pass and baseline images are included for regression testing.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47fdaa020e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread demo/bin/render-test.ts Outdated
Comment thread demo/bin/render-test.ts Outdated
Comment thread lib/renderer.ts Outdated
slang25 and others added 3 commits February 25, 2026 00:08
- Implement renderBlockChar() for U+2580-U+259F block elements as pixel-perfect rectangles
- Implement renderPowerlineGlyph() for U+E0B0-U+E0BF glyphs as vector shapes
- Update font metrics to use fontBoundingBox for accurate cell height
- Add buildFontString() helper for proper font family quoting
- Add cursor style support from buffer and cursorAccent color rendering
- Add 15 visual regression tests covering text, colors, cursors, wide chars, and special glyphs
- Include headless Puppeteer test runner for CI/CD integration
- Add baseline PNG images for all tests passing

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Exit non-zero on startup failures in render test runner (P1)
- Wait for browser-side runAllTests() completion before reading canvases (P2)
- Use || instead of ?? for font metric fallbacks so 0 triggers fallback (P2)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix prettier formatting for render-test.html and correct import order
in render-test.ts to satisfy biome lint rules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@slang25 slang25 force-pushed the slang25/powerline-render-tests branch from 5c82921 to 4e0a84e Compare February 25, 2026 00:08
diegosouzapw added a commit to diegosouzapw/ghostty-web that referenced this pull request May 24, 2026
- Add renderBlockChar() for U+2580-U+259F (block elements) as filled
  rectangles, eliminating inter-character gaps in ASCII art/progress bars
- Add renderPowerlineGlyph() for U+E0B0-U+E0B7 as canvas vector paths,
  ensuring glyphs span exactly the cell height regardless of font
- Switch measureFont() to fontBoundingBox metrics so cell height
  accommodates the full font cap-height (required by powerline chars)
- Merge DPR-aware rounding from PR coder#146 with fontBoundingBox: cells
  stay pixel-perfect at non-integer device pixel ratios
- Pass cursor.style from IRenderable.getCursor() through to renderCursor()
  so callers can override the cursor shape
- buildFontString() helper quotes font family names that contain spaces
- Add demo/bin/render-test.ts and demo/render-test.html for visual
  regression testing (puppeteer auto-installed on demand)
- Fix pre-existing biome lint issues in viewport/iris test files

Co-authored-by: Stuart Lang <stuart.b.lang@gmail.com>
Inspired-by: coder#128
diegosouzapw added a commit to diegosouzapw/ghostty-web that referenced this pull request May 24, 2026
- Add renderBlockChar() for U+2580-U+259F (block elements) as filled
  rectangles, eliminating inter-character gaps in ASCII art/progress bars
- Add renderPowerlineGlyph() for U+E0B0-U+E0B7 as canvas vector paths,
  ensuring glyphs span exactly the cell height regardless of font
- Switch measureFont() to fontBoundingBox metrics so cell height
  accommodates the full font cap-height (required by powerline chars)
- Merge DPR-aware rounding from PR coder#146 with fontBoundingBox: cells
  stay pixel-perfect at non-integer device pixel ratios
- Pass cursor.style from IRenderable.getCursor() through to renderCursor()
  so callers can override the cursor shape
- buildFontString() helper quotes font family names that contain spaces
- Add demo/bin/render-test.ts and demo/render-test.html for visual
  regression testing (puppeteer auto-installed on demand)
- Fix pre-existing biome lint issues in viewport/iris test files


Inspired-by: coder#128

Co-authored-by: Stuart Lang <stuart.b.lang@gmail.com>
@diegosouzapw
Copy link
Copy Markdown

Hi @slang25! 👋

Your work on this PR inspired a commit in my fork diegosouzapw/ghostty-web.
I ported the powerline + block element rendering and added you as co-author in the corresponding commit — thank you for the contribution!

I'm working on OmniRoute, a project that provides free access to LLM models, and I'm planning to use ghostty-web as the terminal component there. Your work is part of what makes that possible. 🙏

Feel free to check it out — contributions and feedback are very welcome!

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.

2 participants