tty: replace custom writer with File.Writer.initStreaming
Replace the custom VTable-based writer implementations in both PosixTty
and WindowsTty with std.fs.File.Writer.initStreaming(). This change
eliminates approximately 50 lines of custom drain logic while providing
better performance through built-in optimizations.
The File.Writer streaming mode is ideal for TTY operations since TTYs
are non-seekable streams. The standard library implementation provides
vectored I/O operations, efficient syscalls like sendfile when
appropriate, and cross-platform compatibility.
All existing APIs remain unchanged - write(), anyWriter(), and
bufferedWriter() methods continue to work as before. Buffer management
is now handled entirely by the standard library rather than custom
code.
Amp-Thread-ID: https://ampcode.com/threads/T-b6d69168-29b7-4ebf-b98f-a38a4e95a0db
Co-authored-by: Amp <amp@ampcode.com>