Updated 'os' to 'posix' for Zig v0.12-3457

This commit is contained in:
00JCIV00 2024-03-28 22:23:18 -04:00 committed by Tim Culverhouse
parent 46b82062de
commit ca0371bc44
2 changed files with 5 additions and 3 deletions

View file

@ -78,7 +78,9 @@ pub fn deinit(self: *Tty) void {
/// stops the run loop
pub fn stop(self: *Tty) void {
self.should_quit = true;
_ = posix.write(self.fd, ctlseqs.device_status_report) catch {};
_ = posix.write(self.fd, ctlseqs.device_status_report) catch |err| {
log.err("TTY Stop Error: {}", .{ err });
};
}
/// read input from the tty
@ -88,7 +90,6 @@ pub fn run(
loop: *Loop(Event),
grapheme_data: *const grapheme.GraphemeData,
) !void {
// get our initial winsize
const winsize = try getWinsize(self.fd);
if (@hasField(Event, "winsize")) {

View file

@ -2,6 +2,7 @@ const std = @import("std");
const builtin = @import("builtin");
const atomic = std.atomic;
const base64 = std.base64.standard.Encoder;
const posix = std.posix;
pub const Cell = @import("Cell.zig");
pub const Image = @import("Image.zig");
@ -239,7 +240,7 @@ pub fn Vaxis(comptime T: type) type {
pub fn queryTerminal(self: *Self) !void {
var tty = self.tty orelse return;
const colorterm = std.posix.getenv("COLORTERM") orelse "";
const colorterm = posix.getenv("COLORTERM") orelse "";
if (std.mem.eql(u8, colorterm, "truecolor") or
std.mem.eql(u8, colorterm, "24bit"))
{