> ## Documentation Index
> Fetch the complete documentation index at: https://docs.otter-shell.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Cell renderer

> CellRenderer, hooks, and Renderer in otter-vte.

## CellRenderer

Comptime cell renderer. You supply hooks for cursor shape, hyperlink hits, and selection highlights.

```zig theme={null}
const vte = @import("otter_vte");

const Hooks = vte.CellRendererHooks(MyCell, MyState);

var renderer = vte.CellRenderer(MyCell, Hooks).init(&state);
try renderer.drawGrid(&cmds, visible_rows, visible_cols);
```

`textRunBatchingSafe` reports whether adjacent cells can merge into one text draw call (same style, no wide-char boundary).

## Renderer facade

`vte.Renderer` wraps command list allocation, damage rects, and `quad_renderer` playback for simpler embedders.

## Integration with otter-term

`otter-term` maps Ghostty screen cells into `MyCell`, wires PTY resize, forwards pointer selection. New terminal drawing belongs in hooks here, not copy-pasted in the app.
