aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-05-18 21:17:49 +0200
committerJakub Konka <kubkon@jakubkonka.com>2020-05-18 21:17:49 +0200
commit57719006bbae3d003f442864339ad7d30a8e05cc (patch)
treeb1622ebd163c1ac49d66fbb93b4a834be02402bc /lib
parent3d267bab71052e652c159a953d87df40f8377546 (diff)
downloadzig-57719006bbae3d003f442864339ad7d30a8e05cc.tar.gz
zig-57719006bbae3d003f442864339ad7d30a8e05cc.zip
Always return false for ANSI escape codes compat in WASI
Diffstat (limited to 'lib')
-rw-r--r--lib/std/fs/file.zig6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig
index 7e6a7dde63..f8cf69cbb8 100644
--- a/lib/std/fs/file.zig
+++ b/lib/std/fs/file.zig
@@ -143,11 +143,9 @@ pub const File = struct {
}
if (builtin.os.tag == .wasi) {
// WASI sanitizes stdout when fd is a tty so ANSI escape codes
- // will not be interpreted as actual cursor commands.
- if (self.handle == os.STDOUT_FILENO and self.isTty()) return false;
+ // will not be interpreted as actual cursor commands, and
// stderr is always sanitized.
- if (self.handle == os.STDERR_FILENO) return false;
- return true;
+ return false;
}
if (self.isTty()) {
if (self.handle == os.STDOUT_FILENO or self.handle == os.STDERR_FILENO) {