fn initStderrWriter(context: ?*anyopaque) callconv(.c) void context: ?*anyopaque3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012fn initStderrWriter(context: ?*anyopaque) callconv(.c) void {
const ev: *Evented = @ptrCast(@alignCast(context));
const cancel_protection = swapCancelProtection(ev, .blocked);
defer assert(swapCancelProtection(ev, cancel_protection) == .blocked);
ev.scan_environ.once(ev, &scanEnviron);
const NO_COLOR = ev.environ.exist.NO_COLOR;
const CLICOLOR_FORCE = ev.environ.exist.CLICOLOR_FORCE;
ev.stderr_mode = Io.Terminal.Mode.detect(
ev.io(),
ev.stderr_writer.file,
NO_COLOR,
CLICOLOR_FORCE,
) catch |err| switch (err) {
error.Canceled => unreachable, // blocked
};
}