Commit graph

20034 commits

Author SHA1 Message Date
Kovid Goyal
db1ea5a87d
glfw: Remove the null/OSMesa and Win32 platform entries
kitty never builds them and the Win32 sources do not exist in the repo.
2026-11-19 19:57:32 +05:30
Kovid Goyal
2489b171c6
Add a build check for the OpenGL GPU driver 2026-11-19 19:57:32 +05:30
Kovid Goyal
b8c266a0d4
Move the kitty OpenGL code into a dynamically loaded GPU driver
All OpenGL calls now live in gpu/opengl, which is built as kitty/opengl.so,
next to the glfw backends. glfw_init() is passed the path to the driver and
loads it. The driver is initialized once the first OpenGL context is
current. fast_data_types no longer links against libGL.

kitty/gpu.c contains the driver loader and the higher level helpers
(programs and their metadata, vertex array objects, viewport stack) that
were previously in kitty/gl.c, implemented on top of the driver API.
shaders.c and the rest of kitty use only the driver API.

Also remove the unused GL_* constants and the unused bind_program,
create_vao, etc. functions exported to Python.
2026-11-19 19:57:32 +05:30
Kovid Goyal
9df76fcdf2
Add a backend neutral GPU driver API
gpu/api.h defines the interface between kitty and dynamically loaded GPU
drivers. It uses only standard C types, with opaque 64 bit handles for all
resources, so that it can be implemented with OpenGL, Vulkan or Metal.
2026-11-19 19:57:32 +05:30
Kovid Goyal
0b56ffd328
panel kitten: Use the invocation cwd and a cleaned env for single instance commands
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
A new panel created via single instance now runs in the working
directory of the invocation, rather than that of the first instance, as
commands run in existing panels and other single instance commands
already do. The environment of the invocation is cleaned up with
process_env() as for other single instance commands, so that variables
such as XDG_ACTIVATION_TOKEN and VTE_VERSION are not passed to the
commands.
2026-11-19 19:56:17 +05:30
Kovid Goyal
d5be3448a6
Use the launch wrapper for commands run via a single instance panel
Commands sent to an already running panel or quick access terminal, both
in existing panels and in newly created ones, are now user launches
passed to the launch wrapper. They have no source window, since they are
not run from any window in the panel. A new panel without a command runs
the shell instead of the run-shell kitten, so the wrapper sees the actual
shell, as for a panel started without single instance.

Closes #10900
2026-11-19 19:53:02 +05:30
Kovid Goyal
9432922221
Merge branch 'codex/fix-launch-wrapper-default-bash' of https://github.com/hezhizhen/kitty 2026-11-19 16:35:23 +05:30
Kovid Goyal
cbdb3a59dd
Fix single window border with draw_window_borders_for_single_window when margin is narrower than border
The layout did not reserve space for the border of a single window, so
the border overlapped the margin and, when the margin was narrower than
the border, extended past the edges of the OS window. The negative
coordinates were then parsed as unsigned, which with rounded borders made
the whole window be covered by the corner fill, hiding its contents.

Reserve the border in layout_single_window_group whenever a full border
is drawn around the window, including when a visible dock causes borders
to be drawn, account for it in the initial OS window size in cells, and
parse border rects as signed integers, clipping them to the OS window.

Fixes #10899
2026-11-19 16:29:10 +05:30
Kovid Goyal
f63baf9f0b
Fix shaping ignoring variation axes of fonts loaded from descriptors
The HarfBuzz font was created before the named instance or axis
coordinates were applied to the FreeType face and was only resynced if
the face had a transform matrix. So shaping used the default variation
coordinates, which broke fonts that substitute glyphs based on axis
values via GSUB FeatureVariations, such as the cursive (CRSV) axis of
Annotation Mono.

Adds a test using a small subset of Annotation Mono (SIL OFL 1.1).

Fixes #10897
2026-11-19 16:14:08 +05:30
Zhizhen He
c5d941b6c0 Fix default Bash detection in launch wrappers 2026-11-19 16:53:30 +08:00
Kovid Goyal
72c2b119c3
dnd kitten: Never create remote directories through a staged symlink
The fix for CVE-2026-54056 only made remote regular file creation
exclusive. A remote source could still send a symlink and then a
directory with the same name, as names were only de-duplicated on
case insensitive filesystems. CreateDirAt() would then follow the
symlink and the directory's children would be written outside the
staging directory.

Always de-duplicate names, create remote directories exclusively and
never follow symlinks when opening a newly created directory.
2026-11-19 12:48:00 +05:30
Kovid Goyal
494e749a43
Ignore CVEs in unreleased versions of dependencies
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-11-19 09:22:09 +05:30
Kovid Goyal
d6f038691c
Parse SGR codes when wrapping text exactly as kitty does
Port the CSI tokenizer and SGR grouping logic from vt-parser.c and
cursor.c so that empty parameters terminated by a semicolon are treated
as zero everywhere, not only in extended colors. This fixes stale
attributes being re-applied on wrapped lines for codes such as ;m, ;31m
and 4:;31m. Also match kitty for codes with invalid characters or
private/intermediate bytes (ignored entirely), misplaced sub-parameters,
mixed colon/semicolon colors, out of range color indices, SGR 21 and
clamped underline styles.

Closes #10895
2026-11-19 09:03:09 +05:30
Zhizhen He
2040665725
Fix wrapping of SGR colors with empty parameters
A semicolon commits an empty CSI field as zero. Skip empty fields at a colon or the CSI terminator so that incomplete extended colors keep the current color when wrapping text.
2026-11-19 08:55:31 +05:30
Kovid Goyal
59bf2c8c92
Fix animated images stopping when switching tabs
Animations are only scanned in the windows of the active tab, so if the
previously active tab had no animations, scanning stopped and was never
restarted when switching back. Request a rescan when the active tab
changes.

Fixes #10894
2026-11-19 08:47:38 +05:30
Kovid Goyal
9a5c37a01d
Fix crash in Screen.hyperlink_at() with out of bounds coordinates
Fixes #10890
2026-11-19 07:23:44 +05:30
Kovid Goyal
c83027daa9
Fix test_launch_wrapper_invalid_shell on macOS
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
On macOS the default shell is run via /usr/bin/login and the run-shell
kitten, with the user wrapper placed inside login, so the expected argv
differs from Linux.
2026-11-18 20:44:44 +05:30
Kovid Goyal
e87f68becd
skip test under qemu emulation 2026-11-18 20:17:58 +05:30
Kovid Goyal
2e62f9c96b
fix flaky test 2026-11-18 19:48:52 +05:30
Kovid Goyal
32f3f1dc71
version 0.51.0
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-11-18 19:06:55 +05:30
Kovid Goyal
ecac1af6dd
Update changelog 2026-11-18 19:06:05 +05:30
Kovid Goyal
5b33eff326
Cleanup previous PR 2026-11-18 17:11:36 +05:30
Kovid Goyal
8c281acb99
Merge branch 'codex/fix-launch-wrapper-shell-fallback' of https://github.com/hezhizhen/kitty 2026-11-18 17:09:59 +05:30
Zhizhen He
c805a6e2a4 Fall back when launch wrapper context setup fails
Building LaunchContext resolves the configured shell. Catch that failure at the launch wrapper boundary so an explicit command can still start.
2026-11-18 19:14:42 +08:00
Kovid Goyal
b4b186a6ad
Cleanup previous PR
- Treat trailing empty SGR color parameters as zero, matching the terminal
- Ignore the color space id in colon form RGB colors (38:2:id:r:g:b)
- Fix bright colors (90-97, 100-107, 38;5;8-15) being re-emitted off by one
- Handle parse errors explicitly and simplify color target selection
- Add tests for SGR state parsing
2026-11-18 15:04:55 +05:30
Kovid Goyal
f8e5ec9345
Merge branch 'codex/fix-sgr-wrap-colors' of https://github.com/hezhizhen/kitty 2026-11-18 15:03:27 +05:30
Zhizhen He
188d248965 Fix wrapping of text with extended SGR colors 2026-11-18 15:33:48 +08:00
Kovid Goyal
8ddc22cd96
Merge branch 'codex/fix-launch-wrapper-child-cache' of https://github.com/hezhizhen/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-11-18 09:48:44 +05:30
Kovid Goyal
179b4b1c5a
docs: Have the :commit: role fall back to linking the given id when there is no git history
Source archives have no git history, so building the docs from them
produced errors for every :commit: reference. Closes #10885
2026-11-18 09:40:29 +05:30
Zhizhen He
fea2fff082 Avoid caching helper PIDs for launch wrappers
A user launch wrapper can start a persistent helper before the command. Use a lone, unmatched child for the current lookup and cache the child only once its command line matches the launch arguments.
2026-11-18 12:04:49 +08:00
Kovid Goyal
8133effda3
Cleanup previous PR
A wrapper that runs the command as a child, rather than exec-ing it, can
run other children before, after or alongside it, such as a script that
runs some setup commands first. Re-check that the cached child of a
wrapper is still its live child, so that root_pid does not get stuck on
an exited helper, or on the command after it exits while the wrapper
keeps running. When a wrapper has several children, prefer the one
running the wrapped command, and only cache the choice if it is certain.

Match wrappers specified by name when their argv[0] is the path they
were found at, as is the case when run by the hold kitten, and wrappers
specified by path only by that exact path.

Compare the wrapper argv and the script arguments with empty arguments
dropped, as cmdline_of_pid() does on Linux, in one place, so that
binary wrappers with empty arguments are also matched.

Add tests for wrappers that run other commands, that exec after being
seen, with prefix and empty arguments, run via the hold kitten, and for
matches_cmdline() and runs_command().
2026-11-18 08:21:55 +05:30
Zhizhen He
8fe8b2bfeb
Fix root PID tracking for script launch wrappers
Recognize the original script invocation after the interpreter arguments so root_pid can follow wrappers that run the command as a child.
2026-11-18 07:50:46 +05:30
Kovid Goyal
a1085a78c3
ask kitten: Fix clicks hitting the wrong choice when the dialog does not fit
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
The dialog was drawn by writing newlines and relying on the terminal to
wrap long lines, recording clickable ranges assuming nothing scrolled or
wrapped. When the content was taller than the window, the screen
scrolled and every clickable range was off by the scroll amount.

Now the full layout is computed up front, with clickable ranges relative
to it, and rows are drawn with absolute cursor positioning and line
wrapping disabled, so the terminal never scrolls or wraps. The boxed
choice layout is used only if it fits entirely, otherwise the compact
one is used, and if even that does not fit, the content is bottom
aligned so the choices remain visible. Choices too wide for the screen
are truncated with an ellipsis.

Also fix:
 - The hidden text placeholder not being clickable when it wraps over
   multiple lines, its clickable range going stale after a resize, and
   its range including one cell too many.
 - Compact choice ranges being computed by iterating over a map, putting
   them in random order when several choices share a line.
 - An empty box row or compact row being output when the first choice is
   wider than the screen.
 - truncate_at_space using a cell width as a byte offset, splitting
   multi-byte characters, and looping forever when a character is wider
   than the available width.

Closes #10883
2026-11-17 19:26:38 +05:30
Kovid Goyal
517f418f9c
Cleanup previous PR
Drop the redundant v2 prefix from the disk cache key, as the key format
already changed when the inode was added.

Render the file the cache key was computed from, so that retargeting a
symlink while rendering, even if it is restored before AddPath() checks
the key again, cannot store the preview of one file under the key of
another. Renderers that need the selected path, custom preview commands
and calibre, opt out via NeedsSelectedPath(). The selected path is also
used when the target has a different extension, as renderers may detect
the format from it.
2026-11-17 19:11:40 +05:30
Zhizhen He
bc7d4664d8 choose-files: Reject stale preview cache writes
Recheck the path key before updating the cache. Include the inode so a replacement with the same size and modification time gets a different key. Version the key to invalidate previously cached previews.

Retry once when a changed path still resolves to a regular file.
2026-11-17 20:47:47 +08:00
Kovid Goyal
24fdd01944
support for publishing from a version branch
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-11-17 03:42:35 +05:30
Kovid Goyal
86be6aa355
Bump version of dependency for CVE 2026-11-17 03:19:17 +05:30
Kovid Goyal
291af51dfa
Show bell indicator on the active tab when the OS window is unfocused
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
A bell in the active window was never marked as needing attention, even
when the OS window did not have keyboard focus, so the tab bar bell
symbol was not shown. Now a window needs attention unless it is both
active and in the focused OS window.

Since the active window can now need attention, also:
- Clear needs_attention when the OS window gains focus, as
  focus_changed() is a no-op if the window became active while the OS
  window was unfocused, which would leave the indicator stuck.
- Use the bell color for minimal borders of an active group needing
  attention, instead of the active color (or the fallback green when
  active_border_color is none).

Fixes #10880
2026-11-16 20:36:28 +05:30
Kovid Goyal
906627df8a
Fix issues with rendering of glyphs wider than their cell
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
Reduce the allowance for cropping glyphs wider than their cell, rather
than rescaling them, to 2/10 of the cell width, since cropping removes
ink, and test that cropped glyphs fill their cell.

FreeType: Move combining marks with their base glyph when it is rescaled
and moved into its cell, so that they stay in place relative to it.

CoreText: Rescale glyphs individually, as with FreeType, so that a
combining mark wider than the cell does not cause its base glyph to be
shrunk. Measure the width of glyphs in whole pixels, as rasterized, as
with FreeType, so that both renderers make the same decision. Never crop
colored glyphs, as with FreeType.

concat_cells: Produce RGBA bytes for 8 bit sprites, as for 32 bit ones,
and handle empty cells.
2026-11-16 17:28:23 +05:30
Kovid Goyal
2e77ef3d4b
FreeType: Move rescaled glyphs right to eliminate left overhang
As with the CoreText renderer, a glyph that is rescaled to fit its cell is
moved so that its ink starts at the left edge of the cell, so that marks that
hang to the left of it, as in polytonic Greek capitals, are no longer cut off.
2026-11-16 17:09:52 +05:30
Kovid Goyal
fd795df1ff
CoreText: Fix glyphs slightly wider than their cell being rendered smaller
Port the overhang allowance from the FreeType renderer: a glyph wider than
its single cell by at most 2/9 of the cell width, with a minimum of 2px, is
cropped rather than rescaled. Previously any glyph whose right edge was more
than 1px past the cell was rescaled, shrinking glyphs such as the d with
caron of Cascadia Code and the texture healing alternates of Monaspace.
Widths are measured per glyph, as with FreeType, so that combining marks do
not cause their base glyph to be shrunk.

The left overhang of a glyph is now taken into account, and a glyph that is
rescaled is moved so that its ink starts at the left edge of the cell, so
that marks that hang to the left of it, as in polytonic Greek capitals, are
no longer cut off. Glyphs that extend past the right edge of the cell are
moved left as far as their left bearing allows, as with FreeType.

Also fix the tests for this to run on macOS: face_from_path() ignored the
font size on macOS and the tests treated pixels with only color bits set as
ink.

Fix concat_cells() for 32 bit sprites, broken since the SIMD compositing
change, which treated the 0xRRGGBBAA sprite pixels as RGBA bytes, producing
an opaque white image.
2026-11-16 17:06:39 +05:30
Pete Dietl
594c96f660
Fix glyphs slightly wider than their cell being rendered smaller
A glyph whose bitmap is wider than its cell is rendered again at a
smaller font size so that it fits, unless it is wider by no more than
two pixels, in which case it is cropped. That allowance is absolute, so
it covers less of the cell as the cell grows, and fonts with glyphs
that overhang their advance by design end up on the wrong side of it:
the texture healing alternates of Monaspace and 0xProto, or the d with
caron of Cascadia Code. Such a glyph is drawn visibly smaller than its
neighbors, at one font size and not at the next.

Make the allowance proportional to the cell width: 2/9 of the cell,
which is the 2px the rule was originally tuned for at the 9px cell of a
typical monospace font at 11pt and 96 dpi, with a minimum of 2px for
smaller cells. That keeps the widest Monaspace alternate, 14% wider
than its cell, at full size. A glyph that overhangs by more, such as a
Greek capital whose breathing mark and accent hang well outside the
cell, is still rescaled, since cropping would remove the marks.

Closes #10879
2026-11-16 14:58:42 +05:30
Kovid Goyal
d6c2ea1160
Request a main loop tick after state changes made from timers
Timers are dispatched outside the main loop tick, so state changed by
them was not rendered while the OS window was otherwise idle, only
catching up when some other event woke the loop. For example, a custom
tab bar refreshed from add_timer, or actions mapped to mouse clicks,
which are dispatched from a timer after click_interval.

Request a tick after every Python timer callback, after dispatching
pending clicks and when marking the tab bar dirty.

Closes #10878
2026-11-16 13:32:14 +05:30
Kovid Goyal
344e4d0913
Merge branch 'dependabot/github_actions/actions-459db3049e' of https://github.com/kovidgoyal/kitty 2026-11-16 11:29:15 +05:30
Kovid Goyal
383704f32b
Merge branch 'dependabot/go_modules/all-go-deps-ba200be5c4' of https://github.com/kovidgoyal/kitty 2026-11-16 11:29:05 +05:30
dependabot[bot]
c2fedfa922
Bump github/codeql-action from 4.39.1 to 4.39.3 in the actions group
Bumps the actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.1...v4.39.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-16 03:44:52 +00:00
dependabot[bot]
15c9444b3f
Bump the all-go-deps group with 3 updates
Bumps the all-go-deps group with 3 updates: [github.com/dlclark/regexp2/v2](https://github.com/dlclark/regexp2), [github.com/nwaples/rardecode/v2](https://github.com/nwaples/rardecode) and [golang.org/x/sys](https://github.com/golang/sys).


Updates `github.com/dlclark/regexp2/v2` from 2.12.0 to 2.13.0
- [Commits](https://github.com/dlclark/regexp2/compare/v2.12.0...v2.13.0)

Updates `github.com/nwaples/rardecode/v2` from 2.4.5 to 2.4.6
- [Commits](https://github.com/nwaples/rardecode/compare/v2.4.5...v2.4.6)

Updates `golang.org/x/sys` from 0.49.0 to 0.50.0
- [Commits](https://github.com/golang/sys/compare/v0.49.0...v0.50.0)

---
updated-dependencies:
- dependency-name: github.com/dlclark/regexp2/v2
  dependency-version: 2.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
- dependency-name: github.com/nwaples/rardecode/v2
  dependency-version: 2.4.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-go-deps
- dependency-name: golang.org/x/sys
  dependency-version: 0.50.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-16 03:43:01 +00:00
Kovid Goyal
ec28187f6f
Fix newly displayed images sometimes not being rendered until the next redraw
prepare_to_render_os_window() decided whether a window needs to be rendered
in layers before calling send_cell_data_to_gpu(), which is what updates the
graphics layers. So on the frame in which an image first becomes visible
grman_has_images() returned a stale false, the window was rendered without
the image, and if nothing else triggered a redraw (for example, the cursor
is hidden so not blinking) the image did not appear until some unrelated
event such as mouse movement.

Fixes #10875
2026-11-16 07:45:22 +05:30
Kovid Goyal
2b260d8d67
Wayland CSD: Re-render on keyboard focus changes
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
The focus state of the decorations comes only from keyboard enter/leave
events, but the decorations were only re-rendered on configure events and
title changes. So they showed a stale focus state whenever focus changed
without a following configure, for example, when switching between tabbed
windows in niri, which keeps all tabs activated.

Re-render the decorations on keyboard enter/leave, looking up the window
again after the focus callbacks have run, since they can close it.

Also:
- Ignore the activated state in the change detection, as focus is tracked
  separately, to avoid rendering twice per focus change.
- Never create decoration surfaces in ensure_csd_resources() for windows
  that should not be decorated, such as fullscreen windows. Title changes
  while fullscreen could previously create them from a stale state.
- Recreate the decoration surfaces when they are missing even if the
  window state is unchanged, otherwise the resize borders were not
  restored after leaving fullscreen with hide_window_decorations
  titlebar-only.

Based on the patch by Ole Jørgen Brønner.

Closes #10873
2026-11-15 20:06:45 +05:30
Kovid Goyal
dea5bd4c24
Update changelog
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-11-15 09:49:43 +05:30