mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 22:33:08 +00:00
Always return false for ANSI escape codes compat in WASI
This commit is contained in:
parent
3d267bab71
commit
57719006bb
@ -143,11 +143,9 @@ pub const File = struct {
|
|||||||
}
|
}
|
||||||
if (builtin.os.tag == .wasi) {
|
if (builtin.os.tag == .wasi) {
|
||||||
// WASI sanitizes stdout when fd is a tty so ANSI escape codes
|
// WASI sanitizes stdout when fd is a tty so ANSI escape codes
|
||||||
// will not be interpreted as actual cursor commands.
|
// will not be interpreted as actual cursor commands, and
|
||||||
if (self.handle == os.STDOUT_FILENO and self.isTty()) return false;
|
|
||||||
// stderr is always sanitized.
|
// stderr is always sanitized.
|
||||||
if (self.handle == os.STDERR_FILENO) return false;
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
if (self.isTty()) {
|
if (self.isTty()) {
|
||||||
if (self.handle == os.STDOUT_FILENO or self.handle == os.STDERR_FILENO) {
|
if (self.handle == os.STDOUT_FILENO or self.handle == os.STDERR_FILENO) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user