mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Handle TERM=dumb for stdout/stderr
This commit is contained in:
parent
e98e5dda52
commit
ef62452363
@ -177,7 +177,17 @@ pub const File = struct {
|
||||
if (windows.is_the_target) {
|
||||
return os.isCygwinPty(self.handle);
|
||||
}
|
||||
return self.isTty();
|
||||
if (self.isTty()) {
|
||||
if (self.handle == os.STDOUT_FILENO or self.handle == os.STDERR_FILENO) {
|
||||
// Use getenvC to workaround https://github.com/ziglang/zig/issues/3511
|
||||
if (os.getenvC(c"TERM")) |term| {
|
||||
if (std.mem.eql(u8, term, "dumb"))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
pub const SeekError = os.SeekError;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user