No description
| example | ||
| src | ||
| .envrc | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
libtui - simple, low-level TUI library
This is a library to make TUI applications. It is targeted mainly at building with a very low-level API, only abstracting all the different tty and terminal quirks, not providing a whole TUI Toolkit to build fancy UIs. That way, this library stays simple and small, understandable and easy to use.
Status
This project is very very alpha, do not use in production or for anything meaningful. The API will probably change quite a bit without any versioning at first. If you are still interested, i would be happy to hear about projects and ideas to improve this library.
Installation
zig fetch --save git+https://git.nkoll.de/nk/libtui.git
// build.zig
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// get the dependecy
const libtui = b.dependency("libtui", .{
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable(.{
.name = "example",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
// add libtui as an import
.{ .name = "libtui", .module = libtui.module("libtui") },
},
}),
});
b.installArtifact(exe);
}
Usage
For a comprehensive example, look at example/main.zig, which shows how to read
and write to the TUI, how to set it up, how to register the resize listener etc.