Coupling the text blink to the cursor blink leads to interesting
problems, such as the text blink stopping when the user is typing,
as the cursor is coded to stop blinking during typing. We now make the
text blink on a separate timer that drives the cursor blink, so that
text input events can easily cancel the cursor blink, waiting for it to
be re-synchronized to the text blink.
The render modes in the vertex shader has always been... strange. It
kind of functioned like an enum and a bitfield at the same time. To
comfortably accommodate adding blink information on cells, I've
refactored it to make it into a true bitfield -- this made the logic
on the Zig side much simpler, with the tradeoff being that logic is
slightly harder to read in the shader code as GLSL does not support
implicitly casting integers after bitmasking to booleans.
The blink is currently synchronized to the cursor blinking (which is
what most other terminal emulators do), though we should be able to
have a separate cell blink timer in the future should the need appear.
Before this a commit a keybind of CTRL + \ would create a GTK
accelerator of <Ctrl>\, which is incorrect. It needs to be
<Ctrl>backslash, which can be retrieved with gdk_keyval_name().
Signed-off-by: Tristan Partin <tristan@partin.io>
When the focus reporting mode (1004) is enabled, send the current focus
state. This allows applications to track their own focus state without
first having to wait for a focus event (or query
it by sending a DECSET followed by a DECRST).
Ghostty's focus state is stored only in the renderer, where the termio
thread cannot access it. We duplicate the focus state tracking in the
Terminal struct with the addition of a new (1-bit) flag. We duplicate
the state because the renderer uses the focus state for its own purposes
(in particular, the Metal renderer uses the focus state to manage
its DisplayLink), and synchronizing access to the shared terminal state
is more cumbersome than simply tracking the focus state in the renderer
in addition to the terminal.
Fixes#2190
The `q` value with chunk transmissions is a bit complicated. The initial
transmission ("start" command) `q` value is used for all subsequent
chunks UNLESS a subsequent chunk specifies a `q >= 1`. If a chunk
specifies `q >= 1`, then that `q` value is subsequently used for all
future chunks unless another chunk specifies `q >= 1`. And so on.
This commit importantly also introduces the ability to test a full Kitty
command from string request to structured response. This will let us
prevent regressions in the future and ensure that we are correctly
handling the complex underspecified behavior of Kitty Graphics.
Fixes#2171
ZLS has caused us issues in our Nix shell before and I noted when we
first added it that we probably shouldn't. We now pin to release
versions of Zig so I think its reasonable to expect developers to have
ZLS installed themselves with the proper version or not use it at all.