This applies to --position, remember_window_position and positions from
sessions, which could otherwise place the window on a monitor that is no
longer connected.
When an on_quit watcher aborted a quit, the application quit request was
left as CONFIRMABLE_CLOSE_REQUESTED, so process_pending_closes() called
boss.quit() on every tick.
Add two new image formats, f=8 with one byte per pixel that is an index
into the terminal color palette and f=16 with a palette index followed by
an alpha byte. Indices 0-247 are the SGR 256 color table entries and
248-255 are special colors: default background, default foreground,
selection background and foreground, cursor, cursor text, URL color and
one reserved slot. Such images change color automatically when the
terminal colors change.
The images are uploaded as integer textures and drawn by a separate
shader program that looks up colors in the existing per window color
table uniform block, so a color scheme change costs nothing extra and
rendering of normal images is unaffected. Programs are switched only at
boundaries between runs of indexed and normal images in draw order. The
shader does bilinear filtering after the palette lookup since integer
textures cannot be filtered. Animation and frame composition are not
supported for these formats.
Closes#10666
Groups that are active until an event turns them off, such as those
using animation_toggle, now also move pointer events, while they are
active. The pointer map is recomputed only when the set of active such
groups changes, and pointer events are left alone once all of them have
been turned off.
Add a shader_event action that sends user:<name> events to the custom
shader pipeline, and an animation_toggle pipeline directive to turn
groups on and off with an event. User events occupy the bits above the
builtin events in a now 64 bit event mask, so firing them costs no more
than any other event and groups that are off are not drawn at all.
Fixes#10667
The glyph for a private use codepoint depends on the font, not the style.
Looking for a bold or italic font covering it tends to find an unrelated
text font that happens to cover it, for example Liberation Serif Italic for
the Nerd Font check mark U+f00c, which rendered as a thin line in the bold
italic title of the active tab.
Restrict the style-ignoring fallback lookup to the Private Use Area ranges
of the Nerd Fonts glyph sets, so that other private use codepoints, which
may be used by fonts that do have styled variants, keep their style.
- Use the SIMD base64 decoder
- Allow ids of up to 263 bytes, the 128 byte limit in the spec is an error
- Drop transient records when a program run with launch --hold exits, even without shell integration
- Drop done and error records when a key is pressed in the window
- Only build the records list when there are watchers
- Count the raw bytes of a report against the length limit
- Strip only ASCII whitespace and discard reports with over long keys regardless of case
- Identical reports do not change which record is shown in the tab bar
Implement revision 0.4 of the Program Status Protocol, which lets a
program report whether it is idle, working, done, blocked on the user
or failed, and why.
- Parse and validate reports per the spec: limits, base64 text without
control characters, malformed ids discard the report instead of
falling back to the root record, unknown states are ignored
- Keep up to 256 records per window (LRU eviction), with clear removing
a record and its descendants and app inherited from ancestors
- Reply to the feature detection query with supported states and kinds
- Lifetime: working/blocked/idle records are dropped at a new shell
prompt (OSC 133;A), done/error are dropped when the window gets focus,
a full reset (RIS) removes every record
- Expose records via tab.program_status in tab_title_template, the
output of kitten @ ls and a new on_program_status_change watcher
Spec: https://www.superlogical.com/rex/docs/build/program-status
Ref: ghostty-org/ghostty#14560, ghostty-org/ghostty#14630
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a pipeline does not declare the a, b or persist textures they are
freed, along with the per window framebuffers for them, but the per window
generation counters are left alone. Loading a pipeline that declares them
again recreates the textures without recreating the framebuffers, since the
generations still match. Passes into those textures then bind framebuffer 0,
which is the backbuffer, so they draw over the terminal contents and only
what the shader draws by itself remains visible.
Reset the generations when the textures are freed, so that the framebuffers
are attached afresh when the textures come back.
Both axes of a scroll event are dispatched, so a diagonal gesture can fire
both, and the event is consumed if either axis is mapped. An unmapped event
continues a mapped gesture only if it scrolls along axes without any mappings.
Recognize the existing directory-symlink marker when scanning, filtering
and deciding which results can be selected. Resolve symlinks before file
filters and cover directory selection and filtered navigation.
Key presses update the IME position, but cursor motion caused by child
output, such as the echo of committed text, did not. The next composition
then started with a stale anchor and its candidate window briefly appeared
at the old position before jumping to the cursor.
Once an IME composition has been seen, push the cursor position to the IME
whenever it changes outside a composition in the active window of the
focused OS window. Nothing extra happens until an IME is used, and there is
no timer, so no feedback loop with GNOME's done events.
Closes#10644
A large write was scheduled on two clocks. The I/O thread woke the main
loop once the previous wake was input_delay old. The parser then refused
a chunk of at least 1KB until input_delay had passed since its first
byte, and armed a timer for the rest. That first turn still painted:
repaint_delay only skips a paint when nothing was parsed and the last
paint is recent. The timer turn parsed the bytes and painted again right
away, because a turn that parsed input ignores repaint_delay. With both
delays at 1ms this was two trips, and often two paints, per large write.
input_delay 0 never holds, so it did the work once and used less CPU.
The I/O thread now asks the parser for one deadline, new_input_at +
input_delay, and sleeps until then. A chunk under 1KB still wakes
immediately, at most once per input_delay. A buffer within 16KB of full
wakes immediately, which is when the parser already refuses to hold.
If a frame callback or another event wakes the main loop while bytes are
held, render returns without painting. The hold timer is already armed.
A thumbnail still paints. A child that exits is taken off the poll set,
so the hold can no longer see it. The main thread is woken when that
child is queued and flush-parses its final output.
A signal stays latched until that wake. signalfd is emptied on the first
poll, so a later poll cannot see the same signal. Without the latch, a
signal that arrived inside the delay was dropped when the next poll had
no parser deadline.
A scanned tail left in the buffer has its timestamp cleared. Those bytes
were already looked at. They are not input waiting out input_delay.
Treating a zero timestamp as ready made every later wake skip the delay.
If monotonic() returns 0 at startup, the commit stores 1, so 0 stays the
empty timestamp and a real chunk still gets a deadline.
- Anchor the IME cursor rectangle at the column the pre-edit text is
actually drawn at, which is shifted left of the cursor when the text
would not otherwise fit on the line, instead of at the cursor column.
- Store the IBus cursor geometry cache per input context rather than in
a function static, only update it after a successful send and reset it
whenever a new input context is created.
- Add a test and a changelog entry.
Add a small Slang lexer and top level declaration parser to slang.py, and
SlangShaderQuery which runs the slangc preprocessor when an answer could
depend on it. Use it for:
- Detecting pointer_map(), so that comments, #if 0 blocks and calls no
longer count, macros are honored, and a pointer_map() that is not public
or does not return float2 is reported instead of failing obscurely. The
result is cached alongside the pipeline module, so a cached load does
not run slangc.
- Applying pipeline var directives, which now work for declarations
spanning multiple lines and match by name as documented.
- Parsing the builtin shaders, with identical results for all of them.
Also cleanup minor issues form previous PR
- Ignore pointer_map() in groups that only draw to part of the screen
- Share the pointer position conversion between glfw.c and mouse.c
- Pass POINTER_MAP_SIZE to the pipeline as a define instead of
duplicating it
- Do not free the pointer map render target on every pipeline reload
- Document what pointer_map() may depend on and when d.mouse_pos lines
up with the pointer
A shader that draws content away from where kitty put it, such as crt
curving the screen, makes clicks and selections land on the wrong cells,
since kitty maps the pointer to the unmodified cell grid. Up to several
columns near the edges with the bundled crt shader.
Shaders can now define pointer_map(pos, d), returning where the content
shown at pos actually is. kitty renders it into a 64x64 grid when the
pipeline or viewport size changes, reads it back once, and uses it to
move all pointer events. Only always active groups that draw to the
screen are used, since only they move content permanently.
The crt shader defines it, sharing its warp function with fragment_main().
Do not show subtitles by default and fix transcription errors in the
subtitle files: kitty.conf, MIME type, --hyperlink=auto, WeeChat,
switch windows, and use lowercase kitty consistently.
- Only restore entry sizes in the Splits layout resize mode was opened in;
otherwise fall back to the default reset rather than refusing to reset
- Do not take a snapshot lazily from already resized sizes when resize mode
was opened in another layout
- Running the resize kitten while its overlay is open replaces the overlay so
the new options take effect, keeping the original-size snapshot
- Newer edge statuses replace older local messages, and edge failures beep
- Switching strategy no longer discards a --fraction command-line override
- Compute divider room without deep copying the pair subtree
- Fractional resize in other layouts adopts the probed state instead of
replaying every step
- Back off on all accept() errors that leave the connection pending, not
just resource exhaustion, so the talk thread cannot spin on a readable
listener
- Use an atomic for the test only accept failure injection instead of
taking the talk mutex on every accept
- Encrypt disk cache entries in chunks of up to 1MB to reduce the number
of write syscalls for large images
- Have GlobalWatchers.set_extra() invalidate the cached watchers
English and Spanish subtitle tracks for the intro video. AI tooling was used
to sync the transcript against the video and to translate it; both tracks
were then manually proofread line by line.
The WebVTT files are shipped in docs/_static, since Sphinx copies that
directory into the output and the video itself is hosted outside the
repository.
Co-Authored-By: space-bunny-free <noreply@opencode.ai>