We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e98e5dd commit ef62452Copy full SHA for ef62452
lib/std/fs/file.zig
@@ -177,7 +177,17 @@ pub const File = struct {
177
if (windows.is_the_target) {
178
return os.isCygwinPty(self.handle);
179
}
180
- return self.isTty();
+ if (self.isTty()) {
181
+ if (self.handle == os.STDOUT_FILENO or self.handle == os.STDERR_FILENO) {
182
+ // Use getenvC to workaround https://github.com/ziglang/zig/issues/3511
183
+ if (os.getenvC(c"TERM")) |term| {
184
+ if (std.mem.eql(u8, term, "dumb"))
185
+ return false;
186
+ }
187
188
+ return true;
189
190
191
192
193
pub const SeekError = os.SeekError;
0 commit comments