zig/lib
Andrew Kelley ffcbd48a12 std: rework TTY detection and printing
This commit sketches an idea for how to deal with detection of file
streams as being terminals.

When a File stream is a terminal, writes through the stream should have
their escapes stripped unless the programmer explicitly enables terminal
escapes. Furthermore, the programmer needs a convenient API for
intentionally outputting escapes into the stream. In particular it
should be possible to set colors that are silently discarded when the
stream is not a terminal.

This commit makes `Io.File.Writer` track the terminal mode in the
already-existing `mode` field, making it the appropriate place to
implement escape stripping.

`Io.lockStderrWriter` returns a `*Io.File.Writer` with terminal
detection already done by default. This is a higher-level application
layer stream for writing to stderr.

Meanwhile, `std.debug.lockStderrWriter` also returns a `*Io.File.Writer`
but a lower-level one that is hard-coded to use a static single-threaded
`std.Io.Threaded` instance. This is the same instance that is used for
collecting debug information and iterating the unwind info.
2025-12-23 22:15:09 -08:00
..
build-web all: replace all @Type usages 2025-11-22 22:42:38 +00:00
c compiler-rt: move strlen from libzigc to here 2025-08-30 06:36:41 +02:00
compiler std.debug: fix printLineFromFile 2025-12-23 22:15:09 -08:00
compiler_rt compiler-rt: implement __clear_cache() for arm/mips64-openbsd 2025-12-16 06:25:15 +01:00
docs std: Remove a handful of things deprecated during the 0.15 release cycle 2025-11-27 20:17:04 +00:00
include remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
init fix: fix typo in comment by removing repeated 'business' word 2025-08-24 23:00:17 +02:00
libc libc: add back freebsd bsm headers 2025-12-21 03:54:17 +01:00
libcxx libcxx: use compiler's _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION when set 2025-11-14 02:02:59 +01:00
libcxxabi remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
libtsan remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
libunwind remove all IBM AIX and z/OS support 2025-10-29 14:25:51 +01:00
std std: rework TTY detection and printing 2025-12-23 22:15:09 -08:00
c.zig libc: use zig isnan and derivates for mingw 2025-08-27 03:58:32 +02:00
compiler_rt.zig compiler-rt: remove dead code 2025-11-12 16:00:16 +00:00
fuzzer.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
ubsan_rt.zig Coff: implement threadlocal variables 2025-10-10 22:47:47 -07:00
zig.h zig.h: drop dependency on deleted compiler_rt functions 2025-11-12 16:00:16 +00:00