Overview
Overview
termbox-glib is a GLib/GObject wrapper around
termbox2, a small terminal I/O library
for building terminal user interfaces.
Use termbox-glib when you want termbox2’s compact terminal drawing and input
model, but you also want it to fit naturally into GLib applications. The wrapper
turns terminal lifetime into a GObject, reports failures with GError,
integrates input with the GLib main loop, and generates introspection metadata
for language bindings.
The library is useful for command-line tools and terminal applications that already use GLib, or for projects that want to write terminal interfaces from C, Vala, GJS, or another GObject Introspection consumer without binding termbox2 by hand.
What It Provides
- A GLib-style API for initializing the terminal, drawing text and cells, and reading input events.
- A
TbgTerminalobject that owns the active terminal session. - Typed signals for key, mouse, resize, and generic terminal events.
- Attribute helpers for default, basic, indexed, and truecolor terminal colors.
- Boxed cell and event types that are usable from introspected languages.
- Generated
Termbox-0.1.gir,Termbox-0.1.typelib, and Vala metadata.
termbox-glib is intentionally close to termbox2. It does not try to be a widget toolkit, layout engine, or application framework. It gives GLib programs direct access to terminal drawing and input primitives.
Status
The project is in early development and is suitable for a first alpha release. It has the main pieces needed to write terminal applications, but the public API and ABI are not stable yet.
Applications should expect source and binary compatibility changes before a stable release.
License and Dependencies
termbox-glib is licensed under LGPL-2.1-or-later. The bundled termbox2 code
is licensed under the MIT license. Some wrapper files mirror or adapt termbox2
constants, API concepts, examples, or documentation and use the SPDX expression
LGPL-2.1-or-later AND MIT.
The runtime dependencies are GLib and GObject 2.84 or newer. termbox2 is bundled into termbox-glib and does not need to be installed separately.
Public Headers
Applications should include the umbrella header:
#include <termbox-glib.h>
Leaf headers are intentionally not directly includable.
Where to Go Next
- Read Termbox Concepts to understand coordinates, cells, buffers, events, and presentation.
- Read Getting Started for the smallest useful C program.
- Read Bindings for Vala and GJS examples.
- Browse
TbgTerminalfor the main API surface.