From e98edbc6cecd285413eefc8f68fd388a8a826b11 Mon Sep 17 00:00:00 2001 From: Nikhil Dave Date: Thu, 8 May 2025 10:08:24 -0700 Subject: [PATCH 1/3] Update build.zig.zon for Zig 0.14 - Change package name to enum literal - Add package "fingerprint" - Bump minimum Zig version to 0.14 (Zig 0.13 errors if I run zig build) --- build.zig.zon | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 692bbe0..c89a119 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,7 +1,8 @@ .{ - .name = "termsize", + .name = .termsize, + .fingerprint = 0x657ac701d6016cd2, .version = "0.1.0", - .minimum_zig_version = "0.12.0", + .minimum_zig_version = "0.14.0", .paths = .{ "build.zig", "build.zig.zon", From 70b484c3187135d5ea0b3650a5031346d851da1c Mon Sep 17 00:00:00 2001 From: Nikhil Dave Date: Thu, 8 May 2025 10:09:43 -0700 Subject: [PATCH 2/3] Fix POSIX winsize usage for Zig 0.14 changes Change where winsize is imported from and change struct field names --- src/main.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.zig b/src/main.zig index 20f1555..011657a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -45,7 +45,7 @@ pub fn termSize(file: std.fs.File) !?TermSize { }; }, .linux, .macos => blk: { - var buf: std.posix.system.winsize = undefined; + var buf: std.posix.winsize = undefined; break :blk switch (std.posix.errno( std.posix.system.ioctl( file.handle, @@ -54,8 +54,8 @@ pub fn termSize(file: std.fs.File) !?TermSize { ), )) { .SUCCESS => TermSize{ - .width = buf.ws_col, - .height = buf.ws_row, + .width = buf.col, + .height = buf.row, }, else => error.IoctlError, }; From 1dfad11dd753b491e2d6a26250ee5b74062cf475 Mon Sep 17 00:00:00 2001 From: Nikhil Dave Date: Thu, 8 May 2025 10:30:25 -0700 Subject: [PATCH 3/3] Update CI workflow to test against Zig 0.14 Should have done this before the CI jobs, sorry --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1108727..1a004a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,7 @@ jobs: - windows-latest - macos-latest zig-version: - - 0.12.0 - - 0.13.0 + - 0.14.0 runs-on: ${{ matrix.os }} permissions: contents: write