# `Drafter.Terminal.Reports`
[🔗](https://github.com/jaman/drafter/blob/main/lib/drafter/terminal/reports.ex#L1)

Replies to the questions a driver asks a terminal at startup, other than the graphics
and keyboard ones.

`cell_size_query/0` asks for the size of one cell in pixels; the reply
`CSI 6 ; height ; width t` parses to `{:cell_size, {width, height}}`.

`pixel_mouse_query/0` asks whether pixel mouse reporting (mode 1016) is set; the reply
`CSI ? 1016 ; status $ y` parses to `{:pixel_mouse, true}` when the status is `1`
(set) or `3` (permanently set), and `{:pixel_mouse, false}` for any other status,
including `0` from a terminal that does not know the mode.

    iex> Drafter.Terminal.Reports.parse("\e[?1016;1$y")
    {[{:pixel_mouse, true}], ""}

    iex> Drafter.Terminal.Reports.parse("\e[?1016;0$y")
    {[{:pixel_mouse, false}], ""}

# `report`

```elixir
@type report() ::
  {:cell_size, {pos_integer(), pos_integer()}} | {:pixel_mouse, boolean()}
```

An event a report parses to.

# `cell_size_query`

```elixir
@spec cell_size_query() :: String.t()
```

The sequence that asks the terminal how many pixels one cell is.

# `parse`

```elixir
@spec parse(binary()) :: {[report()], binary()} | :no_match
```

Parse a report at the head of `buffer`, or `:no_match`.

# `pixel_mouse_query`

```elixir
@spec pixel_mouse_query() :: String.t()
```

The sequence that asks the terminal whether pixel mouse reporting is set.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
