[!WARNING] This library is a WIP and may have breaking changes and bugs.
mibu is pure Zig library for low-level terminal manipulation.
Tested with zig version
2024.11.0-mach
(0.14.0-dev.2577+271452d22)
First we add the library as a dependency in our build.zig.zon
file with the
following command.
zig fetch --save git+https://github.com/xyaman/mibu
And we add it to build.zig
file.
const mibu_dep = b.dependency("mibu", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("mibu", mibu_dep.module("mibu"));
Now we can use the library in our code.
const std = @import("std");
const mibu = @import("mibu");
const color = mibu.color;
pub fn main() void {
std.debug.print("{s}Hello World in purple!\n", .{color.print.bgRGB(97, 37, 160)});
}
See the examples directory
You can run the examples with the following command:
# Prints text with different colors
zig build color
# Prints what key you pressed, until you press `q` or `ctrl+c`
zig build event
zig build alternate_screen
mibu