2aa7f7247657

fix: Align search stdin TTY probe with std.Io.File.isTty (v3.0.13)

- Use the stdlib stdin file TTY check for search fallback detection - Keep plain fallback behavior for non-tty stdin - Verify with build/test and build

time
2026-05-31 12:23 UTC · 4 months ago
machine
koh2
parent
2af4a89e497d
3 files VERSION+1 −1build.zig.zon+1 −1src/search.zig+3 −4
VERSION+1 −1
@@ -1 +1 @@1-3.0.121+3.0.13

view file

build.zig.zon+1 −1
@@ -9,7 +9,7 @@99     .name = .nina,1010     // This is a [Semantic Version](https://semver.org/).1111     // In a future version of Zig it will be used for package deduplication.12-    .version = "3.0.12",12+    .version = "3.0.13",1313     // Together with name, this represents a globally unique package1414     // identifier. This field is generated by the Zig toolchain when the1515     // package is first created, and then *never changes*. This allows

view file

src/search.zig+3 −4
@@ -19,7 +19,7 @@1919     // Non-interactive fallback: when stdin isn't a terminal (piped, scripted,2020     // CI), print plain results and return instead of the raw-mode widget, which2121     // needs a real tty and would block waiting for keys.22-    if (!stdinIsTty()) return runPlain(gpa, io, initial_query, mode);22+    if (!stdinIsTty(io)) return runPlain(gpa, io, initial_query, mode);2323 2424     var saved: std.posix.termios = undefined;2525     try rawModeEnable(STDIN_FD, &saved);@@ -147,9 +147,8 @@147147     };148148 }149149 150-fn stdinIsTty() bool {151-    _ = std.posix.tcgetattr(STDIN_FD) catch return false;152-    return true;150+fn stdinIsTty(io: std.Io) bool {151+    return std.Io.File.stdin().isTty(io) catch false;153152 }154153 155154 // Plain, non-interactive rendering for non-tty stdin. Same pink :: header and

view file