18570 Commits

Author SHA1 Message Date
Kovid Goyal
51116e5df3 ... nightly 2026-07-21 15:34:38 +05:30
Kovid Goyal
e36f6ac1b8 Use most recently focused OS Window when available to guess the monitor to use for fractional scale
Slight improvement in odds of guessing right for subsequent OS Windows.
2026-07-21 13:02:23 +05:30
Kovid Goyal
a8132195d1 ... 2026-07-21 10:16:35 +05:30
Kovid Goyal
bb1088a87a Wayland: Fix using remote control to resize OS windows on some tiling compositors leading to broken rendering 2026-07-21 10:12:34 +05:30
Kovid Goyal
6ed833e163 Wayland: get initial window size in cells working in most cases on hyprland/sway with fractional scaling by using the fractional scale of the primary monitor 2026-07-21 10:03:40 +05:30
Kovid Goyal
a7d7183681 ... 2026-07-21 09:11:50 +05:30
Kovid Goyal
fe9828a0e4 Workaround for dragging not starting on niri
niri for some reason known only to itself does not send any pointer
leave/data device enter/data source events when it accepts a grab. The
only event it seems to send is surface enter on the drag icon surface,
and that too it sends that event much later.

Handle this bonkers behavior by retrying the sync multiple times to
detect if niri has accepted the drag or not.

Fixes #10271
2026-07-21 09:04:45 +05:30
Kovid Goyal
e1414bfcdd Add a note to initial window size docs saying its the typical Wayland potluck whether it works 2026-07-21 08:07:18 +05:30
Kovid Goyal
2f7b2f6d4f Merge branch 'patch-1' of https://github.com/I21b/kitty 2026-07-21 07:20:18 +05:30
don’t have a name currently
b1373eb73b Update long_text of mark2_background
Seems like a typo
2026-07-21 07:30:10 +08:00
Kovid Goyal
0a751263c1 Revert 946867b as it breaks window sizing on some compositors
Fixes #10268
2026-07-20 19:58:00 +05:30
Kovid Goyal
ccc2bba92a Merge branch 'dependabot/github_actions/actions-02548105cf' of https://github.com/kovidgoyal/kitty 2026-07-20 09:17:59 +05:30
dependabot[bot]
fd3126f4e1 Bump github/codeql-action from 4.36.3 to 4.37.0 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.36.3 to 4.37.0
- [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.36.3...v4.37.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-20 03:45:23 +00:00
Kovid Goyal
0e38ca2b86 Merge branch 'wayland-initial-window-size' of https://github.com/egnor/kitty 2026-07-19 13:49:39 +05:30
Dan Egnor
db14d7c220 Wayland: map first window at correct size with fractional scaling
The first OS window on Wayland is created at scale 1 because the
compositor only sends the fractional scale after the surface exists.
The initial size in cells is therefore computed with scale-1 cell
metrics and the window is mapped a few cells too small. The existing
post-map recompute calls glfwSetWindowSize(), but on Wayland that loses
to the compositor's authoritative configure, which re-asserts the size
it recorded at map time. So a window that receives focus (the normal
interactive case) stays too small; a background window that never gets
an activated configure happens to keep the resized value, which is why
it can look fixed.

Correct the size while the window is still unmapped instead. GLFW gains
a hook (glfwWaylandSetInitialWindowSizeCallback) that it invokes when
the fractional scale is applied during creation -- mutter, kwin and niri
send the scale before the first configure -- letting the embedder
recompute the cell-based logical size for the real scale before the
window is mapped. The compositor then records the correct size and its
activation configure agrees, so there is nothing to race.

The existing post-map recompute is kept as a fallback for compositors
that only send the scale after the first configure (sway, Hyprland).

Also add glfwCocoaSetWindowLevel to the glfw.py wrapper generator list:
it was present in the committed glfw-wrapper but missing from the
generator, so regenerating the wrapper (required to add the hook above)
would otherwise drop it and break the macOS build.
2026-07-18 20:48:11 -07:00
Kovid Goyal
5b4ea1bbba version 0.48.0 v0.48.0 2026-07-18 07:37:54 +05:30
Kovid Goyal
4b7aac4999 macOS: Use a private API to ensure OS window is shown on the currently active space when toggled
Fixes #8740
2026-07-16 08:43:06 +05:30
Kovid Goyal
f47590533d Expose soft reset via Python API 2026-07-15 09:36:09 +05:30
Kovid Goyal
0816716c72 Add support for DECSTR soft screen reset escape code
This escape code is largely undefined. There is no specification for how
it affects alternate screen mode, overriden colors, kitty keyboard
state, paused rendering, etc. Do what I feel is sensible in these cases.

Fixes #10263
2026-07-15 09:28:51 +05:30
Kovid Goyal
41c82aa418 ... 2026-07-14 08:15:47 +05:30
Kovid Goyal
83ffaf60bf Bump some dependency versions 2026-07-14 06:15:01 +05:30
Kovid Goyal
40bbbf68e9 Merge branch 'dependabot/github_actions/actions-e1b61632c3' of https://github.com/kovidgoyal/kitty 2026-07-13 09:25:06 +05:30
Kovid Goyal
88bafe65d4 Merge branch 'dependabot/go_modules/all-go-deps-5889c72f55' of https://github.com/kovidgoyal/kitty 2026-07-13 09:24:45 +05:30
dependabot[bot]
8b368bf73f Bump github/codeql-action from 4.36.2 to 4.36.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.36.2 to 4.36.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.36.2...v4.36.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-13 03:45:02 +00:00
dependabot[bot]
ed28c3b202 Bump the all-go-deps group with 3 updates
Bumps the all-go-deps group with 3 updates: [github.com/klauspost/compress](https://github.com/klauspost/compress), [golang.org/x/sys](https://github.com/golang/sys) and [golang.org/x/text](https://github.com/golang/text).


Updates `github.com/klauspost/compress` from 1.18.6 to 1.19.0
- [Release notes](https://github.com/klauspost/compress/releases)
- [Commits](https://github.com/klauspost/compress/compare/v1.18.6...v1.19.0)

Updates `golang.org/x/sys` from 0.46.0 to 0.47.0
- [Commits](https://github.com/golang/sys/compare/v0.46.0...v0.47.0)

Updates `golang.org/x/text` from 0.38.0 to 0.39.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.38.0...v0.39.0)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-version: 1.19.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
- dependency-name: golang.org/x/sys
  dependency-version: 0.47.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
- dependency-name: golang.org/x/text
  dependency-version: 0.39.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-07-13 03:42:57 +00:00
Kovid Goyal
45a97ee5af macOS: Disable macOS one time code autofill popups
Fixes #10250
2026-07-13 09:06:24 +05:30
Kovid Goyal
e966528a14 Update changelog 2026-07-13 09:00:26 +05:30
Kovid Goyal
2b7ac118fb Merge branch 'jq/bugfix-img-xyoff-scrolling' of https://github.com/jquast/kitty 2026-07-13 08:42:24 +05:30
Kovid Goyal
0bf176be5c Make latest version of ty happy 2026-07-13 08:21:56 +05:30
Jeff Quast
efeb4aead0 Fix erroneous scroll when using X/Y offsets in images
Problem
-------

In update_dest_rect() when both num_cols and num_rows are 0
(auto-computed, ``a=T``), the first block computes num_cols with
cell_x_offset, but, then the second block mismatches num_cols, causing
it to compute width_px from num_cols and adds cell_x_offset a second
time. The returned value is large enough that it often causes scrolling,
depending on size and location of the screen.

A sample visual program:

```python
import zlib, base64, time
from functools import partial
echo = partial(print, end='', flush=True)

echo('\033[H\033[J')

base = bytes([0, 128, 0, 255]) * 640 * 576
k = zlib.compress(keyframe, 3)
echo(f'\033[8;60H\033_Ga=T,i=1,q=1,f=32,s=640,v=576,o=z,N=1;{base64.b64encode(k).decode()}\033\\')
time.sleep(1)

delta = bytes([200, 0, 0, 255]) * 32 * 512
d = zlib.compress(delta, 3)
echo(f'\033[9;67H\033_Ga=T,i=100,q=1,f=32,s=32,v=512,o=z,N=1,X=9,Y=25;{base64.b64encode(d).decode()}\033\\')

time.sleep(1)
print()
```

Solution
--------

Add 'auto_cols' and 'auto_rows' to remember the original read-only
values before exercising their auto-calculated size. 'auto_rows' isn't
technically necessary given the logic branching but it describes in code
better.

Before and After video
----------------------

A video will be attached shortly, here.
2026-07-12 18:22:40 -04:00
Kovid Goyal
7ab90de166 Merge branch 'fix/text-cache-gc' of https://github.com/Sinity/kitty 2026-07-12 20:07:45 +05:30
Sinity
ed51a3e97c Benchmark unique multi-codepoint Unicode cells
Add a benchmark stream containing 262,144 distinct base-plus-combining-mark cells per repetition so TextCache collection cost remains visible instead of collapsing into cache hits.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-12 15:27:24 +02:00
Sinity
b8da20444e Run TextCache GC before drawing text
Move the periodic collection check to PREPARE_FOR_DRAW_TEXT so ordinary and fixed-width text share one safe integration point, while tab handling no longer initiates collection.

Reset the additions counter only after the live-cell remap completes successfully.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-12 15:27:24 +02:00
Kovid Goyal
3d64df7492 Update changelog 2026-07-12 12:16:01 +05:30
Kovid Goyal
faec5206d4 Merge branch 'master' of https://github.com/pakhromov/kitty 2026-07-12 12:14:44 +05:30
Kovid Goyal
e0f08269f8 Update changelog 2026-07-12 10:27:56 +05:30
Kovid Goyal
e71c49a17e Merge branch 'fix/historybuf-mmap' of https://github.com/Sinity/kitty 2026-07-12 10:24:14 +05:30
Kovid Goyal
368753682d scroll-window remote control command: Fix a regression that broke scrolling by pages
Fixes #10253
2026-07-12 09:59:34 +05:30
Kovid Goyal
f935258394 Ignore inapplicable CVE 2026-07-12 09:58:05 +05:30
Kovid Goyal
95ded6817b Merge branch 'fix/wayland-egl-failure-crash' of https://github.com/Sinity/kitty 2026-07-12 09:21:07 +05:30
Pavel
edcb87a0de Do not animate cursor trail while the cursor is hidden
Programs that hide the cursor with DECTCEM but keep moving it causes
the trail to run a full animation after every cursor move, which is
unnecessary since the cursor is invisible.

When the cursor is hidden and the trail has fully faded out, snap the
trail corners to the cursor position instead of animating them. The
trail still tracks the hidden cursor, so switching focus to or away
from such a window still animates the trail.
2026-07-12 02:45:44 +02:00
Sinity
d96752e0f1 Allocate history buffer segments with mmap
glibc can raise its dynamic mmap threshold above these MB-scale allocations, routing later scrollback segments through brk. Closing windows then leaves the freed segments stranded in allocator bins and grows the long-lived kitty process.

Back the existing batched segment layout with anonymous mappings instead. This preserves zero-initialization and pointer layout while ensuring the memory is returned to the OS when a history buffer is cleared or destroyed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 21:46:30 +02:00
Sinity
0dc74cd93b Wayland: fail window creation cleanly when the OpenGL context cannot be created
_glfwPlatformCreateWindow() ignored the return value of
attach_opengl_context_to_window(), so when EGL is unavailable (for
example libEGL cannot be loaded) it reported success with
window->context left zeroed. glfwCreateWindow() then proceeded to
_glfwRefreshContextAttribs() -> glfwMakeContextCurrent(), which calls
the NULL context.makeCurrent pointer: kitty crashes with SIGSEGV
instead of reporting "Failed to create GLFWwindow. This usually
happens because of old/broken OpenGL drivers." as intended. The X11
backend already propagates these failures.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 21:04:38 +02:00
Sinity
b2d5a36283 Garbage collect the text cache periodically so unique cell texts do not grow memory without bound
The TextCache interns every unique multi-codepoint cell text for the
lifetime of the window with no eviction, so a stream of unique texts
(for example random combining mark sequences) grows memory without
bound, several hundred MB/hour at moderate throughput.

Mirror the existing hyperlink pool garbage collection: every 8192
newly interned entries, steal the cache contents and have the Screen
remap the index in every live cell (history buffer, main and alt line
buffers, paused rendering snapshot and overlay line), re-interning
only entries still referenced by some cell. Entries whose last
reference scrolled out of the history buffer are freed.

See #10249

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-11 20:40:02 +02:00
Kovid Goyal
2607d22ac3 Merge branch 'copilot/fix-cursor-trail-start-threshold' of https://github.com/kovidgoyal/kitty
Fix #10248
2026-07-10 07:55:51 +05:30
copilot-swe-agent[bot]
7906e0b96b Make cursor_trail_start_threshold accept two values for x and y dimensions independently 2026-07-10 02:05:57 +00:00
Kovid Goyal
996714cff7 Merge branch 'fix-wayland-ime-popup-position' of https://github.com/lsdhophora/kitty 2026-07-09 07:56:39 +05:30
Kovid Goyal
d453586b9c Bump go version for stdlib CVEs 2026-07-09 07:46:27 +05:30
Kovid Goyal
15a44edefc Clean up previous PR 2026-07-09 07:01:18 +05:30
Kovid Goyal
8d6e855480 Merge branch 'feat/quick-access-terminal-layer-config' of https://github.com/qo0u0op/kitty 2026-07-09 06:58:46 +05:30