Raxol.Terminal.Driver.TermboxLifecycle (Raxol Terminal v2.6.0)

Copy Markdown View Source

Termbox NIF initialization, shutdown, and recovery helpers.

Summary

Functions

Cleans up terminal state during shutdown: kills stdin reader, closes tty port, restores terminal modes and original stty settings.

Attempts recovery from a termbox error by shutting down and reinitializing. Returns {:noreply, state} or {:stop, reason, state}.

Initializes termbox. Returns :ok or {:error, reason}.

Shuts down termbox.

Functions

cleanup_terminal(state)

Cleans up terminal state during shutdown: kills stdin reader, closes tty port, restores terminal modes and original stty settings.

handle_recovery(reason, state)

Attempts recovery from a termbox error by shutting down and reinitializing. Returns {:noreply, state} or {:stop, reason, state}.

initialize()

Initializes termbox. Returns :ok or {:error, reason}.

terminate()

Shuts down termbox.