Updated 'os' to 'posix' for Zig v0.12-3457
This commit is contained in:
parent
46b82062de
commit
ca0371bc44
2 changed files with 5 additions and 3 deletions
|
@ -78,7 +78,9 @@ pub fn deinit(self: *Tty) void {
|
||||||
/// stops the run loop
|
/// stops the run loop
|
||||||
pub fn stop(self: *Tty) void {
|
pub fn stop(self: *Tty) void {
|
||||||
self.should_quit = true;
|
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
|
/// read input from the tty
|
||||||
|
@ -88,7 +90,6 @@ pub fn run(
|
||||||
loop: *Loop(Event),
|
loop: *Loop(Event),
|
||||||
grapheme_data: *const grapheme.GraphemeData,
|
grapheme_data: *const grapheme.GraphemeData,
|
||||||
) !void {
|
) !void {
|
||||||
|
|
||||||
// get our initial winsize
|
// get our initial winsize
|
||||||
const winsize = try getWinsize(self.fd);
|
const winsize = try getWinsize(self.fd);
|
||||||
if (@hasField(Event, "winsize")) {
|
if (@hasField(Event, "winsize")) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const atomic = std.atomic;
|
const atomic = std.atomic;
|
||||||
const base64 = std.base64.standard.Encoder;
|
const base64 = std.base64.standard.Encoder;
|
||||||
|
const posix = std.posix;
|
||||||
|
|
||||||
pub const Cell = @import("Cell.zig");
|
pub const Cell = @import("Cell.zig");
|
||||||
pub const Image = @import("Image.zig");
|
pub const Image = @import("Image.zig");
|
||||||
|
@ -239,7 +240,7 @@ pub fn Vaxis(comptime T: type) type {
|
||||||
pub fn queryTerminal(self: *Self) !void {
|
pub fn queryTerminal(self: *Self) !void {
|
||||||
var tty = self.tty orelse return;
|
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
|
if (std.mem.eql(u8, colorterm, "truecolor") or
|
||||||
std.mem.eql(u8, colorterm, "24bit"))
|
std.mem.eql(u8, colorterm, "24bit"))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue