Commit graph

19483 commits

Author SHA1 Message Date
rudolf-blue
dcac4bb35f Fix partial drag data writes and a NULL mime_type dereference on Wayland 2026-10-08 23:59:56 -04:00
rudolf-blue
eff37ff291 Fix drop data buffer overflow and unchecked mmap on Wayland 2026-10-08 23:59:56 -04:00
rudolf-blue
a24311b240 Stop CHT once the cursor reaches the last column 2026-10-08 23:59:56 -04:00
rudolf-blue
3d007dbf9e Fix out of bounds write in single line DECCARA 2026-10-08 23:59:56 -04:00
rudolf-blue
e1250cf8fb Fix erase in line and display orphaning halves of multicell characters 2026-10-08 23:59:56 -04:00
rudolf-blue
a1dc62a710 Use framebuffer copies when growing sprite textures 2026-10-08 23:59:56 -04:00
rudolf-blue
33463560f5 Grow the sprite decorations map geometrically 2026-10-08 23:59:56 -04:00
rudolf-blue
7bdcd8e766 Grow the sprite texture rows geometrically 2026-10-08 23:59:56 -04:00
rudolf-blue
d0a7052ce6 Account for the extra sprite row when computing max sprite rows 2026-10-08 23:59:56 -04:00
Kovid Goyal
237a598cae
Fix heap buffer overflow in unicode_in_range()
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
When growing the buffer, realloc was passed the element count instead of
the byte count, shrinking the buffer while capacity was set to the larger
value. Lines with more than 4096 codepoints (e.g. many combining chars)
would then write past the end of the allocation.
2026-10-08 23:51:48 +05:30
Kovid Goyal
e81c993ce2
Cleanup previous PR
Fix dangling text pointer in buffered key events and test CSI param overflow

Key events buffered while waiting for an overlay to become ready stored
the text pointer from the GLFWkeyevent, which is only valid for the
duration of the key callback. Make the buffered events own a copy of
the text and free it in a single place.

Also add a test for the out of bounds write of is_sub_param when a
separator follows the last allowed CSI parameter.
2026-10-08 23:34:30 +05:30
Kovid Goyal
390306edcc Merge branch 'misc-fixes' of https://github.com/rudolf-blue/kitty 2026-10-08 23:26:21 +05:30
Kovid Goyal
f021526205
Fix #10628 2026-10-08 22:08:13 +05:30
rudolf-blue
20c24fa4f4 icat: Write unicode placeholders in a single write 2026-10-08 12:00:20 -04:00
rudolf-blue
799963bc38 Dont leak the reader goroutine in roundtrip_to_terminal 2026-10-08 12:00:20 -04:00
rudolf-blue
db5d7e027c Minor fixes 2026-10-08 12:00:20 -04:00
rudolf-blue
3a294df4da Round up poll timeout in the I/O loop
Truncating to ms made the loop spin with a zero timeout until the deadline.
2026-10-08 12:00:20 -04:00
rudolf-blue
7468112c0b Fix leak when growing buffered keys 2026-10-08 12:00:20 -04:00
Kovid Goyal
fa9f8dac18
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-08 08:31:32 +05:30
fairyhunter13
1bf03eabaa Graphics: move Unicode placeholder cell images with lines scrolled into history from a region
A line scrolled out of a region whose top is row 0 (tmux with a bottom status line) enters the history, but scroll_filter_margins_func left the refs of history lines in place, so they drew over other lines on the next scroll back. A reverse scroll also moved history refs although the history does not move.
2026-10-08 09:20:16 +07:00
Kovid Goyal
e4187643a6
Fix #10625
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-08 07:23:45 +05:30
Kovid Goyal
24f7369bb6
Drop Unicode placeholder cell images scrolled off the bottom of the screen
A full screen reverse scroll (ESC M at the top, CSI T) moves every image
ref down a row. scroll_filter_func() only removed refs that left through
the top, so a cell image on the bottom line ended up at row `lines`, off
screen, while its line was discarded. The next forward scroll brought it
back onto the bottom row, where the line has no placeholders.
screen_render_line_graphics() returns early for such lines, so nothing
removed the ref and a slice of the old image was drawn over the new text.
tmux and pagers send ESC M when scrolling down, so this shows up in
practice. Fix it by dropping cell image refs that move below the bottom
margin, the same way the margins scroll path drops refs that leave the
region.

This replaces PR #10623, which was not merged for these reasons:

- It does not find the cause. It removes cell image refs at render time
  for every line without placeholders, so the stale ref still exists and
  is still seen by anything that reads refs before the next render, such
  as graphics query and delete commands and the paused rendering path,
  which returns before the new code.
- It costs time on every frame. Whenever any image is loaded, even with
  no placeholders at all, each clean visible line and each visible
  history line triggers a walk over all images and refs. Before, such
  lines cost nothing. This fix adds one comparison to a loop that only
  runs when the screen scrolls.

Close #10623
2026-10-07 20:19:23 +05:30
Kovid Goyal
7e7355ccbe
make ty 85 happy
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-07 05:07:04 +05:30
Kovid Goyal
9f61eaf0f2
Increase notarization timeout 2026-10-07 04:32:42 +05:30
Kovid Goyal
96693f4c09
Merge branch 'fix/scroll-animation-close' of https://github.com/M-Hassan-Raza/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-06 19:30:29 +05:30
Hassan Raza
3142901159
Stop scroll animations when closing a window 2026-10-06 18:51:05 +05:00
Kovid Goyal
8ca3cc0d30
Merge branch 'fix/docs-command-examples' of https://github.com/M-Hassan-Raza/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-06 17:01:25 +05:30
Hassan Raza
35c9a02018
Use launch in the remote control example 2026-10-06 16:04:16 +05:00
Hassan Raza
f8470df186
Correct the documentation dependency install command 2026-10-06 16:04:16 +05:00
Kovid Goyal
ccd671c658
Merge branch 'toplevel_data_for_drag' of https://github.com/Safari77/kitty 2026-10-06 15:37:12 +05:30
Kovid Goyal
2932c6994a
Fix #10619 2026-10-06 15:36:13 +05:30
Kovid Goyal
a73c7cbc0a
Fix #10618 2026-10-06 15:29:26 +05:30
Sami Farin
712276412a toplevel_data_for_drag: check for NULL from as_file_url
Avoid segfault in strlen() inside finish_remote_data() if
as_file_url returns NULL.
2026-10-06 12:56:57 +03:00
Kovid Goyal
4fd2ecc2c5
autoformat 2026-10-06 15:21:45 +05:30
Kovid Goyal
5421df1cd3
Cleanup previous PR
Fix problems found while reviewing the EINTR handling changes to
safe-wrappers.h merged from PR #10615.

- safe_connect: the PR waited for POLLOUT and read SO_ERROR after an
  EINTR from connect(). That only works for sockets where an interrupted
  connect continues in the background, such as TCP. AF_UNIX stream
  sockets on Linux are left unconnected but writable, so safe_connect
  returned success on an unconnected socket. This broke the single
  instance launcher when the server's listen backlog was full. Now
  connect() is retried after EINTR, EISCONN on a retry is treated as
  success, and poll()+SO_ERROR is used only on EALREADY. While waiting,
  SO_SNDTIMEO is honored (with a monotonic deadline across EINTR from
  poll) instead of polling with an infinite timeout. The EAGAIN retry
  the PR dropped is restored.

- safe_mkstemp: rather than copying the template into a PATH_MAX buffer,
  which rejected templates longer than 1024 bytes on macOS/BSD, restore
  only the trailing X characters when mkostemp() is interrupted. Use
  mkostemp(O_CLOEXEC) on all platforms. macOS has had it since 10.12 and
  disk-cache.c already relied on it. This removes the duplicated
  platform #if blocks and the racy mkstemp+fcntl(FD_CLOEXEC) fallback.

- disk-cache: open_cache_file_without_tmpfile had its own mkostemp EINTR
  loop with the same template corruption bug. Use safe_mkstemp instead.

- Add safe_write_all() and use it in place of the hand-written write
  loops in dnd.c and the single instance launcher. Also fix
  finish_remote_data() in dnd.c, which passed -1 instead of errno to
  abrt() when writing the uri list failed.
2026-10-06 15:16:15 +05:30
Sami Farin
448aeefe5d
safe-wrappers.h fixes
- safe_mkstemp: fix template corruption and atomicity
    mkstemp mutates the template in place, causing subsequent retries on
    EINTR to fail with EINVAL. Save the template before invocation and use
    atomic mkostemp(..., O_CLOEXEC) on supported platforms.

- safe_connect and safe_accept: fix socket connection state machine
    - safe_connect: Retrying connect() on EINTR violates stream socket semantics
      (yields EISCONN/EALREADY). Poll for POLLOUT and query SO_ERROR instead.
    - safe_accept: Remove EAGAIN busy-wait loop to avoid 100% CPU spin on
      non-blocking sockets or when timeouts expire.

- safe_write: prevent stream corruption
    Comparing ret != 0 caused successful writes (> 0) to repeat whenever
    stale EINTR remained in errno, duplicating payload data across PTY and
    socket streams. Change check to ret < 0.

- safe_close: eliminate descriptor reuse race
    POSIX-compliant modern kernels (Linux, macOS, BSDs) detach and release
    file descriptors before handling signal interruptions. Looping close() on
    EINTR risks closing an unrelated file descriptor allocated concurrently
    by another thread.
2026-10-06 15:16:09 +05:30
Kovid Goyal
ce459fb1a4
Merge branch 'fix/go-test-diagnostics' of https://github.com/M-Hassan-Raza/kitty 2026-10-06 15:12:13 +05:30
Hassan Raza
c137a577d8
Retain Go diagnostics when the test process fails 2026-10-06 14:31:17 +05:00
Kovid Goyal
6732123dfb
Merge branch 'fix/test-launcher-path' of https://github.com/M-Hassan-Raza/kitty 2026-10-06 14:01:41 +05:30
Kovid Goyal
08e7488c30
Bumpversion of openssl for CVEs 2026-10-06 13:37:28 +05:30
Hassan Raza
35b4e5838b
Use the running launcher directory in test PATH 2026-10-06 12:55:31 +05:00
Kovid Goyal
affbdaea37
Merge branch 'fix/go-test-selection' of https://github.com/M-Hassan-Raza/kitty 2026-10-06 13:10:42 +05:30
Hassan Raza
e18a2e3ec6
Run all requested Go test names 2026-10-06 12:17:51 +05:00
Kovid Goyal
5466034fcf
macOS: Improve throughput when input_delay=0
Closes #10611
2026-10-06 12:10:50 +05:30
Kovid Goyal
a5c75acb7d
handle invalid UTF-8 in binary mime db
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-06 08:58:50 +05:30
Kovid Goyal
c168e31801
Use binary XDG shared MIME database for mimetype lookups
Fixes #3056
2026-10-06 08:27:55 +05:30
Kovid Goyal
7218cc0915
...
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-05 20:47:23 +05:30
Kovid Goyal
d3236c5aab
Merge branch 'fix-cell-images-after-paused-render' of https://github.com/fairyhunter13/kitty 2026-10-05 20:47:16 +05:30
Kovid Goyal
51aa327be1
Fix momentum scroll scale not being set for negative deltas
The scale between scaled and unscaled offsets was only calculated for
positive deltas, so when scrolling up or left it stayed at zero (or stale from
a previous scroll), causing momentum events to have zero offsets.

Closes #10610
2026-10-05 20:42:16 +05:30
Kovid Goyal
007e61a59e
Fix #10609 2026-10-05 20:34:59 +05:30