Commit graph

19249 commits

Author SHA1 Message Date
Kovid Goyal
50eaaf5d15
Merge branch 'fix-case-insensitive-completion-matching' of https://github.com/devangpratap/kitty 2026-09-16 10:56:25 +05:30
Kovid Goyal
dac0357514
Update changelog 2026-09-16 10:55:04 +05:30
Kovid Goyal
65b02b21f4
Splits: Fix issues with proportional sizing
Fixes found while reviewing #10471:

- A window squeezed to zero size (by maximize or an extreme bias) was
  indistinguishable from a removed one, so closing an unrelated window
  handed its share to windows in sub-trees that lost nothing. Track
  survivors separately from the numeric weight.

- Pruning a batch of windows gave a different layout than closing them
  one by one, since a perpendicular sub-tree stops being perpendicular
  once removals collapse it. Apply the policy one window at a time.

- Windows reconciled by do_layout(), rather than split off an existing
  window, bypassed the policy entirely. Route them through it too.

Also fix two pre-existing bugs on the same code paths:

- collapse_redundant_pairs() collapsed top down, so a pair whose
  children only became empty during the recursion was never
  re-examined and was left in the tree, consuming its share of the
  space.

- do_layout() kept using a stale pairs root when removing windows
  collapsed the tree, so windows added in the same relayout were
  attached to the discarded root and vanished for a frame.
2026-09-16 10:47:59 +05:30
devangpratap
ebb41b83da Fix completion of directories containing files with uppercase extensions
Completion patterns are lowercased in make_completer and file names are
lowercased before being matched against them, but the names of files inside
a directory were passed to the matcher unchanged. A directory whose only
matching file was named something like B.CONF was therefore never offered as
a completion candidate for a *.conf pattern, while the same file named
b.conf worked.
2026-09-16 00:43:53 -04:00
Kovid Goyal
791614ce93 Merge branch 'splits-proportional' of https://github.com/xiaobai050/kitty
# Conflicts:
#	kitty_tests/layout.py
2026-09-16 09:23:31 +05:30
Kovid Goyal
1f20d43198
Update changelog 2026-09-16 08:44:59 +05:30
Kovid Goyal
a11839a2c7
Merge branch 'fix/nested-split-border-resize' of https://github.com/xiaobai050/kitty 2026-09-16 08:42:29 +05:30
Kovid Goyal
2d6d47a3f8
Merge branch 'fix-symlink-dir-completion' of https://github.com/devangpratap/kitty 2026-09-16 08:33:30 +05:30
devangpratap
04082039be Fix completion of symlinks to directories for directory arguments 2026-09-15 14:09:41 -04:00
Kovid Goyal
0c19dbfa8f
Merge branch 'fix-root-path-completion' of https://github.com/devangpratap/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-09-15 22:05:05 +05:30
Kovid Goyal
b0b5c286c5
cleanup previous PR and fix some bugs I doscovered while doing it 2026-09-15 22:04:44 +05:30
devangpratap
fd904d45d8 Fix completion of paths directly under the root directory 2026-09-15 11:15:04 -04:00
Kovid Goyal
5d04347411
cleanup docs for previous PR 2026-09-15 20:04:59 +05:30
Kovid Goyal
bde35f3dd0
Merge branch 'feature/tab-to-split' of https://github.com/xiaobai050/kitty 2026-09-15 20:03:11 +05:30
Kovid Goyal
bab67650e2
Test suite: Fix small numbers of Python tests being run in incorrect environment
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
Also fix env reporting. Fixes #10478
2026-09-15 16:50:21 +05:30
Kovid Goyal
e1bdb2c66f
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-09-15 09:50:22 +05:30
Kovid Goyal
4a5e693194
Merge branch 'fix/cocoa-ime-long-commits' of https://github.com/xiaobai050/kitty 2026-09-15 09:49:35 +05:30
Kovid Goyal
784340ae37
Merge branch 'go-shlex-empty-quoted-strings' of https://github.com/anandghegde/kitty 2026-09-15 08:52:05 +05:30
Kovid Goyal
5669b7c369
Merge branch 'add_absolute_keyboard' of https://github.com/btpence/kitty 2026-09-15 07:54:58 +05:30
Kovid Goyal
b592bd1e72
... 2026-09-15 07:51:41 +05:30
btpence
c7496a54d7
Add additional implementations of the keyboard protocol
Add AbsoluteTelnet/SSH client to the list of terminals that implement kitty keyboard
2026-09-14 16:30:58 -05:00
Kovid Goyal
3d9f394b4a
possible fix for test failing in macOS CI
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-09-14 22:06:37 +05:30
Kovid Goyal
87ab3e98f4
Graphics protocol: Fix file descriptor leak that can be triggered by malicious clients
Also make failure responses generic to avoid leaking any filesystem
information to failed opens
2026-09-14 21:03:15 +05:30
白鸽
7cbea2f539 Remove runtime-compiled Cocoa IME regression tests 2026-09-14 20:37:02 +08:00
白鸽
120cad0cba Fix native tab drop completion and offset hit testing 2026-09-14 20:07:58 +08:00
白鸽
82085561a0 Splits: Preserve perpendicular shares on batch removal 2026-09-14 20:07:57 +08:00
白鸽
7faf714da2 Allow dropping single-window tabs into another tab layout 2026-09-14 19:17:54 +08:00
白鸽
cced6bb355 Splits: Add optional proportional sizing 2026-09-14 19:17:53 +08:00
白鸽
d3d3f1735d Splits: Resize the correct divider in nested layouts 2026-09-14 19:17:51 +08:00
Anand Hegde
8b564c7094 Go shlex: Do not drop empty quoted strings
Port the fix from 2093fb131 in the C shlex implementation to the Go one.
Previously an argument such as "" or '' was silently dropped, since an
empty word was also used to signal EOF. So "launch --title '' vim" in the
kitty shell was parsed as "launch --title vim". EOF is now signalled with
a negative Pos.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MA8JGs7pCoXFL2W6jEJ8sD
2026-09-14 16:09:51 +05:30
Anand Hegde
0791b39abb Fix completion after a trailing space in the kitty shell
SplitForCompletion computed the position of the new empty word as if
the previous word were one byte long, so tab completing after a space
following a multi-character word replaced part of that word. For example,
completing "launch --type " in the kitten @ shell produced
"launch --window ". The new word starts at the end of the input.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MA8JGs7pCoXFL2W6jEJ8sD
2026-09-14 16:09:05 +05:30
白鸽
4ef2df194a macOS: Preserve long IME commits outside key handling 2026-09-14 17:39:28 +08:00
Kovid Goyal
a54b409785
Fix #10467
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-09-14 14:23:45 +05:30
Kovid Goyal
5cf63d9cc5
Merge branch 'dependabot/go_modules/all-go-deps-9162e99b95' of https://github.com/kovidgoyal/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-09-14 09:21:45 +05:30
dependabot[bot]
da3248eea9
Bump the all-go-deps group with 3 updates
Bumps the all-go-deps group with 3 updates: [github.com/ebitengine/purego](https://github.com/ebitengine/purego), [github.com/klauspost/compress](https://github.com/klauspost/compress) and [golang.org/x/sys](https://github.com/golang/sys).


Updates `github.com/ebitengine/purego` from 0.10.2 to 0.11.0
- [Release notes](https://github.com/ebitengine/purego/releases)
- [Commits](https://github.com/ebitengine/purego/compare/v0.10.2...v0.11.0)

Updates `github.com/klauspost/compress` from 1.19.2 to 1.20.0
- [Release notes](https://github.com/klauspost/compress/releases)
- [Commits](https://github.com/klauspost/compress/compare/v1.19.2...v1.20.0)

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

---
updated-dependencies:
- dependency-name: github.com/ebitengine/purego
  dependency-version: 0.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
- dependency-name: github.com/klauspost/compress
  dependency-version: 1.20.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.48.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-09-14 03:43:12 +00:00
Kovid Goyal
74b7ef892f
Fix always active custom shaders stopping when window is idle
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-09-13 10:08:11 +05:30
Kovid Goyal
9710eb4460
Ignore inapplicable CVEs
Some checks failed
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Has been cancelled
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Has been cancelled
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Has been cancelled
CI / Linux package (push) Has been cancelled
CI / Bundle test (macos-latest) (push) Has been cancelled
CI / Bundle test (ubuntu-latest) (push) Has been cancelled
CI / macOS Brew (push) Has been cancelled
CI / Test ./dev.sh and benchmark (push) Has been cancelled
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (c, macos-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Has been cancelled
Depscan / Scan dependencies for vulnerabilities (push) Has been cancelled
2026-09-11 07:02:32 +05:30
Kovid Goyal
69bf7e2fc5
Merge branch 'shaped-run-4k-slabs' of https://github.com/j-c-m/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-09-10 22:32:02 +05:30
Jesse Miller
9806100346 Pack shaped run cache arenas in 4 KiB blocks
I've been running with the shaped run cache and some extra logging,
decided to bump to a 4KiB slab. The theoretical and actual waste do show
up during use. My initial sizing was only a best guess based of glyph
cache and a 32 cell run typically fitting just below a 2KiB slab.
2026-09-10 09:20:13 -06:00
Kovid Goyal
e436d55b71
Shaped run cache: bound real memory use, not requested bytes
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 running byte counter summed the sizes requested from the arenas.
The arenas serve allocations from fixed size blocks and strand the tail
of a block whenever the next allocation does not fit, so the counter
understated real usage. For runs of 17 to 20 columns, where the value
allocation lands just over half a block, only one value fits per block
and the cache grew to ~2MB against a 1MB cap. As the limit applies per
Font, that overshoot is multiplied across every font in a FontGroup.

Track bytes actually malloced in the arena itself instead, so the cap
check stays O(1), which was the point of the counter, while measuring
the same thing the walking count used to.
2026-09-09 21:15:43 +05:30
Kovid Goyal
dd25eb8538
arena: do not memset a NULL pointer when posix_memalign fails
The memset was run unconditionally after posix_memalign, so an
allocation failure crashed in memset instead of returning NULL to the
caller, defeating the OOM handling in every arena user.
2026-09-09 21:15:34 +05:30
Jesse Miller
5a1341a4d9 Shaped run cache, keep used byte counter vs walking count per miss
Another small tweak to the shaped run cache, keep a running byte
counter to avoid the walking count on cache put. Although the walking
count was noise next to the harfbuzz shaping, this is much better.
2026-09-09 21:10:04 +05:30
Kovid Goyal
9f32b8648a
Minor improvements to the shaped run cache
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
- Build the cache key once per run rather than once in shaped_run_get()
  and again in shaped_run_put(), which had to walk the cells and query
  the text cache a second time on every cache miss

- Do not zero the entire groups array on a cache hit, the groups that are
  actually read are all overwritten by the cached ones

- Drop the cache when an arena allocation or the insert fails, instead of
  leaking the space allocated for the entry, since monotonic arenas
  cannot free individual allocations
2026-09-09 09:29:50 +05:30
Kovid Goyal
6dc6d1cc54
Fix buffer overflow in the shaped run cache key
fill_key() sizes its scratch buffer assuming every cell holds at most
MAX_NUM_CODEPOINTS_PER_CELL codepoints. The draw paths in screen.c
enforce that, but Line.add_combining_char() does not, so a line built via
the Python API with more codepoints in a cell overflows the key buffer
once the run is long enough. Bail out of caching such runs instead.
2026-09-09 09:29:25 +05:30
Kovid Goyal
fd6008cd99 Merge branch 'shaped-run-cache' of https://github.com/j-c-m/kitty
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-09 09:19:36 +05:30
Jesse Miller
073957f014 Cache HarfBuzz text shaping results
Wire the shaper-cache to actually be used for shaped runs.

On a 10s loop of the same short-word screen (~16ms/frame), main-thread
CPU dropped ~28% vs master and hb_shape samples went to 0.

Parse speed remains unchanged (and fast), verified with kitten __benchmark__.
2026-09-08 13:56:39 -06:00
Jesse Miller
c655a592f9 Add shaped run cache
Per-font verstable map of exact run keys to glyph infos, positions and
cell groups. Skip runs longer than 32 cells. Full-drop at 2048 entries
or 1 MiB of live storage.

The intention here is to avoid shaping the same runs over and over again
on an active screen. This used to not have much of an impact, but now
"modern" full screen TUIs are actively drawing the screens in such a way
that harfbuzz shaping is showing up as a more significant portion in
profiling runs.

The cache is sized to not be a long-lived history but able to cache most
repeated runs on a few active screens.
2026-09-08 13:56:39 -06:00
Kovid Goyal
0b12ed8c41
...
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-09-08 18:55:51 +05:30
Kovid Goyal
df999b05e5 Fix drag gesture state leaking past the button event early returns
Follow-ups to the drag_or_normal_select selected text drag support:

- Reset the pending drag at the top of handle_button_event again, before
  the scrollbar, missing screen and mouse position early returns. Moving
  it into a helper placed it after those returns, so a scrollbar track
  click (with scrollbar_jump_on_click disabled) no longer cleared an
  armed URL drag, letting it fire on a later mouse move with no button
  held. Split the helper in two, as arming the drag needs an up to date
  mouse position but clearing it does not.

- Clear the click queue for all drag kinds, not just text drags. A native
  drag consumes mouse-up, so the press lingered and turned the next press
  into a double press, selecting a word instead of starting a new
  gesture. Reproducible with link drags before this change.

- Note that handle_potential_drag can call into Python, which can
  re-alloc the windows array, so w must not be used after it returns.

Also share the drag thumbnail construction between drag_url and
drag_selection (and skip the thumbnail rather than dividing by zero on a
zero width render), use None instead of -1 for the mock event pixel
position so negative positions remain testable, and tighten the
off-by-one bound in clear_click_queue.
2026-09-08 18:51:02 +05:30
Kovid Goyal
d90869a8c6 Merge branch 'feature/drag-selected-text' of https://github.com/xiaobai050/kitty 2026-09-08 18:44:56 +05:30