commits
Apply the same Writer API integration to WindowsTty that was done for
PosixTty. This provides consistent buffered writing capabilities across
both Windows and POSIX platforms using Zig 0.15.1's new Writer API.
The embedded writer uses @fieldParentPtr to access the parent WindowsTty
instance from the drain function, enabling efficient writes to the
Windows console handle when the buffer is full or flushed.
Add write() method and update opaqueWrite() to use the embedded writer
instead of direct windows.WriteFile() calls, providing automatic
buffering for better performance by reducing system call overhead.
Amp-Thread-ID: https://ampcode.com/threads/T-e1192d32-b3c3-43a6-b434-33fe5664bf0a
Co-authored-by: Amp <amp@ampcode.com>
Integrate Zig 0.15.1's new Writer API into the PosixTty structure by
embedding a std.io.Writer field with a 4096-byte buffer. This provides
buffered writing capabilities with proper VTable implementation.
The embedded writer uses @fieldParentPtr to access the parent PosixTty
instance from the drain function, enabling efficient writes to the
terminal file descriptor when the buffer is full or flushed.
Updated write() and opaqueWrite() methods to use the embedded writer
instead of direct posix.write() calls, providing automatic buffering
for better performance by reducing system call overhead.
Amp-Thread-ID: https://ampcode.com/threads/T-e1192d32-b3c3-43a6-b434-33fe5664bf0a
Co-authored-by: Amp <amp@ampcode.com>
The Zig fetcher is really finicky when it comes to proxies, even more so
when it comes to Git dependencies. Given that both GitHub and Codeberg
have tarball archive downloads I don't see why we need to use a Git clone
at all here
Use upstream. Instead of using the 0.14.1 release we are opting for this
commit since it includes the removal of `usingnamespace`, which means we
can have incremental compilation
Misuse of contractions.
See also:
- https://search.brave.com/search?q=it%27s+vs+its
- https://www.merriam-webster.com/grammar/when-to-use-its-vs-its
Fix vxfw.Surface.satisfiesContraints to properly check constraints.
Implement the kitty scaled text extension. We do this by adding a Scale
struct to the core Cell structure. The scale struct defines the scale,
numerator, denominator, and vertical positioning. We also query
independently for scaled text vs explicit width text.
Users of scaled text must be very careful of how they model their cells,
as cells must be written ahead of time with knowledge of the
capabilities of the underlying terminal. Libvaxis does not move contents
of cells based on scale (ie 3 contiguous cells of scale=2 with contents
"abc" will not transform into what you think - the user of the library
must take car to put a, b, and c into appropriate cells. Libvaxis will
do the work to prevent overwriting the cell). Capability can be checked
in the vx.caps.scaled_text value.
This reduces the time in Vaxis.render. I ran perf several times for ~60
seconds each time on example/vaxis.zig.
Before => 15.17% in Vaxis.render
After => 14.15% in Vaxis.render
This was introduced in zig 0.14
Why didn't I do this earlier? This results in about a 20% memory savings
when testing out the examples. We have 3 arraylists per Cell, so for
each cell we now save usize * 3 = 192 bytes, for my typical full screen
terminal I have 239 x 47 cells. That's a total of 2.1Mb!
The queue was signaling a pop that's waiting for the queue to not be
empty before we had actually added something to the queue. This change
moves the signal to after the push has been done so we're not signaling
a pop with a still-empty queue.
Needed for fixing https://github.com/ghostty-org/ghostty/issues/6734
This reverts commit 3a70d898d5ef52b61f3cae03c5ebab0aa9749e05.
Squash this commit once upstream zg has accepted a PR which updates for
recent zig
Apply the same Writer API integration to WindowsTty that was done for
PosixTty. This provides consistent buffered writing capabilities across
both Windows and POSIX platforms using Zig 0.15.1's new Writer API.
The embedded writer uses @fieldParentPtr to access the parent WindowsTty
instance from the drain function, enabling efficient writes to the
Windows console handle when the buffer is full or flushed.
Add write() method and update opaqueWrite() to use the embedded writer
instead of direct windows.WriteFile() calls, providing automatic
buffering for better performance by reducing system call overhead.
Amp-Thread-ID: https://ampcode.com/threads/T-e1192d32-b3c3-43a6-b434-33fe5664bf0a
Co-authored-by: Amp <amp@ampcode.com>
Integrate Zig 0.15.1's new Writer API into the PosixTty structure by
embedding a std.io.Writer field with a 4096-byte buffer. This provides
buffered writing capabilities with proper VTable implementation.
The embedded writer uses @fieldParentPtr to access the parent PosixTty
instance from the drain function, enabling efficient writes to the
terminal file descriptor when the buffer is full or flushed.
Updated write() and opaqueWrite() methods to use the embedded writer
instead of direct posix.write() calls, providing automatic buffering
for better performance by reducing system call overhead.
Amp-Thread-ID: https://ampcode.com/threads/T-e1192d32-b3c3-43a6-b434-33fe5664bf0a
Co-authored-by: Amp <amp@ampcode.com>
Implement the kitty scaled text extension. We do this by adding a Scale
struct to the core Cell structure. The scale struct defines the scale,
numerator, denominator, and vertical positioning. We also query
independently for scaled text vs explicit width text.
Users of scaled text must be very careful of how they model their cells,
as cells must be written ahead of time with knowledge of the
capabilities of the underlying terminal. Libvaxis does not move contents
of cells based on scale (ie 3 contiguous cells of scale=2 with contents
"abc" will not transform into what you think - the user of the library
must take car to put a, b, and c into appropriate cells. Libvaxis will
do the work to prevent overwriting the cell). Capability can be checked
in the vx.caps.scaled_text value.