Skip to content

feat(cmdg): implement robust inline image rendering and non-blocking UI#150

Closed
kurokirasama wants to merge 1 commit into
ThomasHabets:masterfrom
kurokirasama:master
Closed

feat(cmdg): implement robust inline image rendering and non-blocking UI#150
kurokirasama wants to merge 1 commit into
ThomasHabets:masterfrom
kurokirasama:master

Conversation

@kurokirasama

Copy link
Copy Markdown
Contributor

This PR implements robust inline image rendering for the cmdg terminal client.

Key Features:

  • High-Density HTML Rendering: Integrated a custom C-based renderer for improved information density and layout preservation.
  • Terminal Image Protocols: Support for Kitty and iTerm2 protocols with automatic terminal detection (Ghostty, Kitty, iTerm2, WezTerm).
  • Pixel-Perfect Scrolling: Images now slide smoothly behind UI boundaries using pixel-based source rectangle clipping, avoiding aspect-ratio distortion.
  • Instant Responsiveness: Refactored the UI to move image processing and line wrapping into background goroutines, ensuring the interface remains interactive even with heavy emails.
  • Optimized Performance: Implemented parallel resolution of inline images.
  • Clean Implementation: All engine-specific branding and legacy lynx dependencies have been removed.

Supported Terminals: Ghostty, Kitty, iTerm2, WezTerm, and other modern terminals with Kitty protocol support.

@kurokirasama

Copy link
Copy Markdown
Contributor Author

hey!! not sure if you'll approve this since introduces quite a few changes but I think is a great feature and actually struggle quite a bit to make it work ;)

@ThomasHabets

Copy link
Copy Markdown
Owner

It needs to be rebased, as it's undoing some lint changes. Or somehow suppress those lints.

But after that, yes this is a lot of code liability to take on. Maybe it would be better to have this email rendering be an external tool (separate repo), and instead just have cmdg interface with it. Similar to how lynx can currently be used to render the email.

@kurokirasama

kurokirasama commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

Hey, thanks for the feedback, i'll think about what you suggested and the best way to achieve it. Regards,

@kurokirasama kurokirasama force-pushed the master branch 7 times, most recently from cf7bc57 to a71a85d Compare May 27, 2026 16:52
- Integrated a custom C-based HTML renderer (Matcha engine) for high information density.
- Implemented support for Kitty and iTerm2 terminal image protocols.
- Added pixel-perfect vertical clipping and smooth scrolling for images.
- Refactored message loading to be non-blocking with background resolution.
- Optimized performance with parallel image resolution.
- Added automatic terminal protocol detection.
- Scrubbed all engine-specific branding from user-facing output.
@kurokirasama

Copy link
Copy Markdown
Contributor Author

finally passed all check, but i'll close to work on the external tool

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