the.bay.news

How to properly use std.Io.Terminal.setColor() in Zig 0.17?

Ziggit
How to properly use std.Io.Terminal.setColor() in Zig 0.17?
Hi! I’m learning Zig 0.17.0-dev and I’m trying to understand the new std.Io.Terminal API. I can write to stdout like this: const std = @import(“std”); pub fn main(init: std.process.Init) !void { const io = init.io; var stdout_writer = std.Io.File.stdout().writer(io, &.{}); const stdout = &stdout_writer.interface; try stdout.print(“Hello world!\n”, .{}); } But I can’t figure out how to use std.Io.Terminal.setColor() correctly. From what I understand, setColor needs a Terminal and a Colo...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.