Drafter.CellSession.Driver (drafter v0.3.2)

Copy Markdown View Source

A terminal driver that holds a screen size and discards everything written to it.

Satisfies the write/2 and get_size/1 contract Drafter.Compositor requires of a terminal driver. Drafter.CellSession reads the composited cell grid out of the compositor's buffer directly and never needs the encoded ANSI stream, so the bytes passed to write/2 are dropped. set_size/2 resizes the virtual surface.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_size(pid)

@spec get_size(pid()) :: {pos_integer(), pos_integer()}

set_size(pid, size)

@spec set_size(
  pid(),
  {pos_integer(), pos_integer()}
) :: :ok

start_link(size)

@spec start_link({pos_integer(), pos_integer()}) :: GenServer.on_start()

write(pid, data)

@spec write(pid(), iodata()) :: :ok