# `Raxol.Terminal.Integration.Renderer`
[🔗](https://github.com/DROOdotFOO/raxol/blob/v2.8.0/lib/raxol/terminal/integration/integration_renderer.ex#L1)

Handles terminal output rendering and display management using Termbox2.

`:termbox2_nif.tb_set_cursor/2`, `tb_clear/0` and `tb_present/0` discard
termbox's status and always return `:ok`, so the calls built on them
(`clear_screen/1`, `move_cursor/3`, showing the cursor with
`set_cursor_visibility/2`, and the cursor and present steps of `render/1`)
cannot report a termbox failure: they return `:ok` even when termbox
rejected the call, for example before `init_terminal/0`.

Hiding the cursor uses `:termbox2_nif.tb_hide_cursor/0`, which does return
termbox's status, so a rejected hide is reported. While the cursor is
hidden, `render/1` leaves it hidden instead of placing it.

# `clear_screen`

Clears the terminal screen (specifically, the back buffer) and presents it.
Returns `:ok`; termbox failures are not reported (see the moduledoc).

# `get_dimensions`

Gets the current terminal dimensions.
Returns {:ok, {width, height}} or {:error, :dimensions_unavailable}.
Note: termbox2 width/height C functions return int, not status codes.
A negative value might indicate an error (e.g., not initialized).

# `get_title`

Gets the terminal title.

# `init_terminal`

Initializes the underlying terminal system.
Must be called before other rendering functions.
Returns :ok or {:error, reason}.

# `move_cursor`

Moves the hardware cursor to a specific position on the screen and presents
it. Returns `:ok`; termbox failures are not reported (see the moduledoc).
Coordinates that are not 32-bit integers raise `ArgumentError`.

# `new`

Creates a new renderer with the given options.

# `render`

Renders the current terminal state to the screen.
Returns :ok or {:error, reason}.

# `reset_config`

Resets the renderer configuration to defaults.

# `resize`

Resizes the renderer to the given dimensions.

# `set_config_value`

Sets a specific configuration value.

# `set_cursor_visibility`

Shows or hides the cursor and records `:cursor_visible` in the config.

Showing places the cursor at the cursor manager's position. If termbox
rejects a hide, the error is logged and the state is returned unchanged.

# `set_title`

Sets the terminal title.

# `shutdown_terminal`

Shuts down the underlying terminal system.
Must be called to restore terminal state.
Returns :ok or {:error, reason}.

# `update_config`

Updates the renderer configuration.

---

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