Commit graph

3927 commits

Author SHA1 Message Date
Zhizhen He
9c21523215
action: Report parsing errors to remote control clients 2026-10-18 15:48:36 +08:00
Kovid Goyal
2d59dd477a
... 2026-10-18 12:55:28 +05:30
Hassan Raza
3d3d2abfe0
Reference the CLI option fix in the changelog 2026-10-18 11:49:00 +05:00
Hassan Raza
608e46be33
Reject options whose required value is missing 2026-10-18 11:46:17 +05:00
Kovid Goyal
2efa09dd07
Fix #10684 2026-10-18 08:28:21 +05:30
Kovid Goyal
22cfda44df
Fix visual window select treating an empty allowed set as unrestricted
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
2026-10-18 08:11:51 +05:30
Kovid Goyal
c0b384f310
Cleanup previous PR 2026-10-18 07:58:49 +05:30
Hassan Raza
d6061b4270
Report cursor rows relative to the origin margin 2026-10-17 13:37:52 +05:00
Kovid Goyal
f7a16a9319
Show custom OS window and tab titles in the detach_tab chooser
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
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
2026-10-17 12:37:54 +05:30
Kovid Goyal
bea239edb1
Allow narrower vertical tab bars
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
2026-10-17 11:35:23 +05:30
Kovid Goyal
277ff7f1e1
Fix #10679 2026-10-17 11:12:49 +05:30
Zhizhen He
bb4a3324e7
Fix remote_control run with non-terminal stdin 2026-10-17 13:12:22 +08:00
Kovid Goyal
b7a657de10
Fix ls --self and --output-format being ignored in remote_control mappings
The Python implementation of message_to_kitty did not forward these
options in the payload, so they only worked via kitten @.
2026-10-17 10:15:49 +05:30
Zhizhen He
38004ded76
Fix --configured in set-enabled-layouts mappings 2026-10-17 10:28:04 +08:00
Zhizhen He
07ab3d3409
send-key: Honor --exclude-active
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.
2026-10-16 23:09:18 +08:00
Kovid Goyal
f426c08f5d
Apply deferred directory permissions children first when extracting tar
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.
2026-10-16 19:12:51 +05:30
Kovid Goyal
dad7089d10
make a note that saved session data can be read by any process that runs as the user 2026-10-16 17:21:40 +05:30
Kovid Goyal
01a2aabc56
Fix #10675
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
2026-10-16 17:10:00 +05:30
Kovid Goyal
0ea80af638
Fix #10672 2026-10-16 13:03:15 +05:30
Kovid Goyal
7e2a3cf81f
Fix #10673 2026-10-16 12:57:07 +05:30
Kovid Goyal
cd1dc74270
Add a reference to the PR that was inspiration for session restore 2026-10-16 12:45:14 +05:30
Kovid Goyal
8f0b7eff31
Encrypt sessions saved at logout with a key in the macOS Keychain
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.
2026-10-16 11:57:31 +05:30
Kovid Goyal
76a00e5142
macOS: Optionally restore kitty, including scrollback, after logging out
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
2026-10-16 11:41:27 +05:30
Kovid Goyal
d4eb2b34e6
Sessions: Add os_window_position and save_as_session --os-window-geometry
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.
2026-10-16 11:29:28 +05:30
Kovid Goyal
beca032240
Ignore initial OS Window positions that are not on any monitor
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.
2026-10-16 11:27:13 +05:30
Kovid Goyal
6a3cfbcb10
Sessions: Fix os_window_size being ignored when remember_window_size is enabled
A size specified in the session now takes precedence over both the
remembered size and the remembered maximized state.
2026-10-16 11:26:53 +05:30
Kovid Goyal
92e2fc477c
Fix on_quit watchers being called repeatedly when they abort an OS quit request
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.
2026-10-16 11:26:07 +05:30
Kovid Goyal
8e99fba8ec
Fix #10668
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
2026-10-16 07:35:45 +05:30
Kovid Goyal
50ede63f29
... 2026-10-16 07:05:23 +05:30
Kovid Goyal
535c7502e8
Graphics protocol: Add indexed color image formats
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
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
2026-10-15 22:05:23 +05:30
Kovid Goyal
7dbfb0e1ce
Custom shaders: Use pointer_map() of groups turned on and off by events
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.
2026-10-15 21:27:18 +05:30
Kovid Goyal
28aad4345e
Custom shaders: Allow controlling shaders with key presses
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
2026-10-15 20:56:31 +05:30
Kovid Goyal
5bf3c2dc67
Cleanup previous PR
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
2026-10-13 21:05:16 +05:30
Zhizhen He
ee491f4d44
Program status: Preserve displayed progress on identical reports 2026-10-13 22:29:38 +08:00
Kovid Goyal
32a77d3cf7
Fix colors 16-255 being set to white by ssh and themes kittens when theme leaves them unset
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
Fixes #10661
2026-10-13 14:03:22 +05:30
Kovid Goyal
4b977494c5
... 2026-10-13 09:34:02 +05:30
Kovid Goyal
39b55885ba
Ignore bold and italic when looking for a fallback font for private use characters
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.
2026-10-13 09:26:29 +05:30
Kovid Goyal
ed0d236708
Program status protocol: fixes and improvements
- 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
2026-10-13 08:50:39 +05:30
Kovid Goyal
0e1b7f4812
Merge branch 'feat/osc-7501-program-status' of https://github.com/ttys3/kitty 2026-10-13 08:29:47 +05:30
Kovid Goyal
163e271250
Fix #10658 2026-10-13 08:21:05 +05:30
ttyS3
00f7a0abd5
feat: support the Program Status Protocol (OSC 7501)
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>
2026-10-12 22:31:38 +08:00
Iurii Lunev
3046d28e9f
Custom shaders: Fix stale framebuffers for re-declared named textures
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.
2026-10-12 16:24:07 +03:00
Kovid Goyal
e0382c0138
mouse_map: Allow mapping horizontal scrolling with wheel_left and wheel_right
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.
2026-10-12 11:25:25 +05:30
Kovid Goyal
0ae80efa10
Merge PR #10590: Allow mapping the scroll wheel with mouse_map
# Conflicts:
#	docs/changelog.rst
2026-10-12 11:00:08 +05:30
Zhizhen He
38ed84edf5
choose-files: Handle symlinks to directories
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.
2026-10-12 10:08:06 +08:00
Kovid Goyal
b78a6aa30f
Merge branch 'add-show-your-work' of https://github.com/iamumeransari/kitty
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
2026-10-11 20:23:29 +05:30
Kovid Goyal
216c77fdda
Fix #10651 2026-10-11 20:22:52 +05:30
Umer Ansari
7d9ca1b060 Add show-your-work to integrations 2026-10-11 14:09:07 +05:00
Zhizhen He
d91ab369e4
Fix locking during concurrent disk cache access 2026-10-11 12:56:24 +08:00
Kovid Goyal
2414d64e67
Keep the IME anchor following the cursor when child output moves it
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
2026-10-11 09:46:17 +05:30