Conversation
…le in snapshots Read the remaining SGR flags from GhosttyStyle and DECTCEM from GHOSTTY_TERMINAL_DATA_CURSOR_VISIBLE. Cell flags are omitted when unset, matching bold/italic/underline. inverse is the raw attribute; colors are not swapped. Closes #15 Change-Id: I4e10cde9ffd9e8b79171b1945692e9560664ffb2 Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Closes #15
Summary
Snapshots now expose the remaining SGR cell attributes and DECTCEM cursor visibility, so coder/agent-tty (coder/agent-tty#171) can render reverse video, strikethrough, dim and hidden text, and hide the cursor.
SnapshotCellgains optionalfaint(SGR 2),inverse(SGR 7),invisible(SGR 8) andstrikethrough(SGR 9).bold/italic/underline: the key is present withtrueonly when set, and omitted otherwise.inverseis the raw attribute.foreground/backgroundare not swapped.TerminalSnapshotgainscursorVisible?: boolean. The native binding always sets it (true/false); the type is optional for compatibility.GhosttyStyle.{faint,inverse,invisible,strikethrough}via the existingghostty_grid_ref_stylecall, andghostty_terminal_get(GHOSTTY_TERMINAL_DATA_CURSOR_VISIBLE). No new libghostty entry points.CHANGELOG.mdis not hand-edited: therelease-changelogworkflow generates it with Communique onrelease/v*PRs.Existing fields are unchanged.
Tests (written first, red before the native change)
ESC[1;2;3;4;7;8;9m).ESC[31;42mcolors.cursorVisible: defaulttrue,ESC[?25lgivesfalse(with and withoutincludeCells),ESC[?25hgivestrue.Validation
npm run build:libghostty(pinned Ghostty 48ccec18, Zig 0.15.2)npm run build:nativenpm run buildnpm run typecheck(and an ad hoctscrun includingtest/)npm testnpm run smokeThe repo has no lint script.
Dogfood
A standalone Node ESM script imports
@coder/libghostty-vt-node(linked to this branch's build), feedsESC[?25l, thenESC[31;42;7mI ESC[27mi ESC[0m ESC[9mS ESC[29ms ESC[2mF ESC[22mf ESC[8mH ESC[28mh ESC[1;2;7;8;9mX ESC[0mx, thenESC[?25h, and printssnapshot({ includeCells: true }):Script
Output (one cell per line):
{"cursorSteps":[{"label":"initial","cursorVisible":true,"cursorRow":0,"cursorCol":0},{"label":"after ESC[?25l","cursorVisible":false,"cursorRow":0,"cursorCol":0},{"label":"after ESC[?25h","cursorVisible":true,"cursorRow":0,"cursorCol":14}],"line0":"Ii Ss Ff Hh Xx"} {"row":0,"col":0,"text":"I","width":1,"inverse":true,"foreground":"#cc6666","background":"#b5bd68"} {"row":0,"col":1,"text":"i","width":1,"foreground":"#cc6666","background":"#b5bd68"} {"row":0,"col":2,"text":" ","width":1} {"row":0,"col":3,"text":"S","width":1,"strikethrough":true} {"row":0,"col":4,"text":"s","width":1} {"row":0,"col":5,"text":" ","width":1} {"row":0,"col":6,"text":"F","width":1,"faint":true} {"row":0,"col":7,"text":"f","width":1} {"row":0,"col":8,"text":" ","width":1} {"row":0,"col":9,"text":"H","width":1,"invisible":true} {"row":0,"col":10,"text":"h","width":1} {"row":0,"col":11,"text":" ","width":1} {"row":0,"col":12,"text":"X","width":1,"bold":true,"faint":true,"inverse":true,"invisible":true,"strikethrough":true} {"row":0,"col":13,"text":"x","width":1}The uppercase cells carry the attribute, and the lowercase cells after each reset do not.
Ikeeps#cc6666on#b5bd68(palette 1 on palette 2), the same as unswappedi.Notes for agent-tty
foreground/backgroundyourself, substituting your default colors when either one is absent.invisiblecells still report their text, andvisibleLines/getVisibleText()still include hidden text (unchanged). Skip drawing glyphs forinvisiblecells.cellsonly contains cells with text. Erased cells that have only a background color (for example, anESC[Kstatus bar fill) are not emitted.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high