Skip to content

Expose inverse, strikethrough, faint, invisible and cursor visibility in snapshot cells #15

Description

@ThomasK33

Request

Expose the remaining SGR cell attributes and the cursor visibility mode in snapshot() output:

  • SnapshotCell: inverse (SGR 7), strikethrough (SGR 9), faint (SGR 2), invisible (SGR 8).
  • TerminalSnapshot: cursor visibility (DECTCEM, ESC[?25h / ESC[?25l), for example cursorVisible: boolean.

Why

agent-tty (coder/agent-tty) replays recordings through snapshot({ includeCells: true }) to export deterministic SVG without a browser (coder/agent-tty#171). In 0.1.0-beta.0, SnapshotCell (dist/types.d.ts) exposes only bold, italic, underline, foreground and background. TerminalSnapshot has cursorRow and cursorCol but no visibility flag. As a result:

  • Reverse-video, strikethrough, dim and hidden text render as plain text. Reverse video matters most: TUIs use it for selection bars, status lines and fuzzy-finder highlights (fzf, htop, less).
  • The cursor is always drawn, even after an application hides it with ESC[?25l.

Suggested shape

Optional booleans, following the existing bold?/italic?/underline? convention, so current consumers keep working:

export interface SnapshotCell {
  // existing fields...
  inverse?: boolean;
  strikethrough?: boolean;
  faint?: boolean;
  invisible?: boolean;
}
export interface TerminalSnapshot {
  // existing fields...
  cursorVisible?: boolean;
}

Report inverse as the raw attribute rather than pre-swapping foreground and background, so consumers can apply their own default colors. Once this ships, agent-tty can map the fields in its native backend (src/renderer/libghosttyVt/backend.ts) and SVG renderer (src/export/svg.ts), which already honors an optional cursorVisible flag.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions