2aa7f7247657
fix: Align search stdin TTY probe with std.Io.File.isTty (v3.0.13)
- time
- 2026-05-31 12:23 UTC · 4 months ago
- machine
- koh2
- parent
- 2af4a89e497d
↓ nina-2aa7f724.tar.gzatlas at this save
files changed3 files
VERSION+1 −1build.zig.zon+1 −1src/search.zig+3 −4build.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 allowssrc/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