Repository navigation
fix(web): terminal citation previews look like the terminal - #312
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The preview now follows the terminal's font family, size and line height settings, and the bundled Nerd Font symbols are available to DOM text, so powerline prompt glyphs render as they do in the terminal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adding a terminal selection to chat now also captures it from Ghostty as VT text, keeping only SGR sequences, and stores it as an optional styledText on the terminal context record. The hover preview parses it into styled runs drawn with the terminal theme's palette and background. Agents still receive only the plain text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Consecutive runs that share a background now sit in one background box. Cells land on fractional pixels, so two adjacent boxes of the same color each antialiased their shared edge and left a light seam, most visible after powerline separators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hovering a terminal citation chip showed its output as plain text in the app's code font without wrapping, inside a fixed-width popover. Long lines got cut off behind a horizontal scroll, Nerd Font prompt glyphs showed as empty boxes, and every colour was lost.
terminalFontFamilystack the terminal uses. The terminal's bundled Symbols Nerd Font is now also declared in CSS, limited to the private-use range, so DOM text draws powerline separators and devicons. It only downloads when one of those glyphs is on screen.ghostty_terminal_selection_format_bufwithemit = VT). That output begins with the whole 256-colour palette as OSC 4 (about 6 KB), so the capture keeps only text and SGR sequences, and drops the copy when it has no styles or exceeds 128 KB. It is stored as an optionalstyledTextonTerminalContextRecord, so chips in sent messages keep their colours too. The preview parses it into styled runs drawn with the terminal theme's palette, 256-colour cube and background. Consecutive runs that share a background are painted as one box, because adjacent same-colour boxes at fractional pixel offsets leave an antialiased hairline seam between them. Agents still receive only the plaintext; the provider formatters do not read the new field.Excerpts added before this change have no
styledTextand show plain text. Mobile shows terminal context in a sheet without a hover preview and is unchanged.docs/fork-differences.mdhas a new entry.Tests cover the SGR parser, what the capture keeps and drops, and a real Ghostty selection round trip. Checked in the web client by adding coloured
git log,git status, ANSI and 256-colour output and a powerline prompt to the composer.Made with Claude Opus 5.5 in Claude Code, running in T3 Code.
🤖 Generated with Claude Code