An empty only_window_ids meant every window was selectable, so for example
select-window --exclude-active in a single window tab returned the active
window. Use None to mean unrestricted instead.
Closes#10683
Store fixed OS window titles at creation time so they can be queried,
and add an only_if_overridden flag to get_os_window_title so callers
can distinguish a custom title from the cached active window title.
The detach_tab chooser now uses the custom OS window title if any,
falling back to the tab's effective title.
This also fixes launch --os-window-title=current not copying a fixed
title and Wayland CSD titles of fixed title windows not being
re-rendered on font size changes.
Closes#10681
When tab_title_max_length is set, size the vertical tab bar to fit the
decorations drawn by the current tab_bar_style instead of always adding
eight cells. Also allow powerline tabs in vertical tab bars to show a
title in a narrow tab bar, since the separator has a column of its own.
Fixes#10680
Exclude the active window before dispatching keys when requested. Add a
regression covering both values of the option with distinct active and
invoking windows, and update the changelog.
A parent directory without search permission prevents changing the
permissions of its children, so apply the deferred chmods in reverse
order, as GNU tar does. Also add a test and changelog entry for #10676.
Every snapshot is encrypted with AES-256-GCM using a random key, stored
in the login keychain under a random id. The name of every file is
authenticated, so files cannot be swapped. The key is deleted before the
snapshot whenever it is removed, so copies of the snapshot left on disk
or in backups cannot be read.
The keychain is never allowed to show any UI. If storing the key fails
nothing is saved, if reading it fails the snapshot is deleted, with the
error logged in both cases.
The key is generated, stored and read only in C, in mlocked memory that
is cleared when freed, via a new random_secret() and the Keychain
functions in cocoa_window.m.
A new option restore_session_after_logout. When macOS asks kitty to quit
because the user is logging out, restarting or shutting down, every kitty
instance saves a snapshot: its session, including OS Window geometry, the
scrollback of every window and the command line, working directory and
environment of the instance.
The next kitty started without a session or command to run claims all
snapshots, restores the one saved by an instance with the same command
line itself and starts a separate kitty instance for each of the others,
so every instance keeps its own command line arguments and environment.
Snapshots are deleted only after their windows have been created. A
snapshot that fails to restore twice, for example because kitty crashed,
is deleted. Snapshots from an earlier logout that were never restored are
deleted when saving, using the wall clock start time of the process.
Restored scrollback is parsed before the child is allowed to run, after
the window has its final size. Only the scrollback and screen are saved,
not the scrollback pager history. Before parsing, everything except SGR,
OSC 8 and OSC 66 is removed, so a modified snapshot cannot run escape
codes such as OSC 52, and the restored output has no shell integration
marks. Programs other than the shell are not started again.
A quit is treated as being for a logout only if it is confirmed within
LOGOUT_CONFIRMATION_TIMEOUT of the logout request, and not if the quit
was cancelled in between.
Fixes#1197
The geometry of fullscreen OS Windows is the one from before they were made
fullscreen. On macOS this is now also recorded when using native fullscreen
via the window buttons/menu.
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