authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-05-18 21:17:49+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-05-18 21:17:49+02:00
log57719006bbae3d003f442864339ad7d30a8e05cc
treeb1622ebd163c1ac49d66fbb93b4a834be02402bc
parent3d267bab71052e652c159a953d87df40f8377546

Always return false for ANSI escape codes compat in WASI


1 files changed, 2 insertions(+), 4 deletions(-)

lib/std/fs/file.zig+2-4
......@@ -143,11 +143,9 @@ pub const File = struct {
143143 }
144144 if (builtin.os.tag == .wasi) {
145145 // WASI sanitizes stdout when fd is a tty so ANSI escape codes
146 // will not be interpreted as actual cursor commands.
147 if (self.handle == os.STDOUT_FILENO and self.isTty()) return false;
146 // will not be interpreted as actual cursor commands, and
148147 // stderr is always sanitized.
149 if (self.handle == os.STDERR_FILENO) return false;
150 return true;
148 return false;
151149 }
152150 if (self.isTty()) {
153151 if (self.handle == os.STDOUT_FILENO or self.handle == os.STDERR_FILENO) {