Commit graph

19576 commits

Author SHA1 Message Date
Kovid Goyal
4fa2cf249d
Cleanup previous PR
Require ModeSymlink when checking the SymlinkToDir marker as it shares a
bit with the other-execute permission, use a single helper for the check,
avoid stat() on hidden entries that will be skipped and treat symlinks to
directories as directories in save file path completion.
2026-10-12 09:36:21 +05:30
Kovid Goyal
f390eec17d Merge branch 'pr-10653' 2026-10-12 08:09:09 +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
Kovid Goyal
7a751292bb
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
Replace exported get_dir files atomically so paths returned by Get/Add
never briefly vanish while another worker re-exports the same key.
Don't panic in Get for a key folder missing from entries.json.
Propagate errors from unlocking, document the lock()/unlock() contract,
and fix the NewDiskCache lock error test which checked the wrong cache
2026-10-11 12:11:06 +05:30
Kovid Goyal
faa50dfdcb Merge PR #10648: Fix locking during concurrent disk cache access 2026-10-11 12:02:56 +05:30
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
Kovid Goyal
0a9c1f0112
Cleanup previous PR
Fix the input wake scheduling issues

- Never stall input the main loop was woken for: the main thread parses on
  signal turns too and accepts any chunk the I/O thread woke it for, and a
  chunk is only marked as woken from the state the wake was decided on.
- Keep held deadlines across a wake and drop the duplicate main loop timer
  for held input, so a held chunk is scheduled once.
- Accept a small chunk that grows before the main thread parses it, rather
  than refusing it and needing another round trip.
- Only skip painting an OS window when none of its windows parsed new input,
  and find held windows without a per screen search.
- Query only parsers that were read or have pending input, without taking
  the children lock, and wake for removed children only when the main thread
  did not request the close.
- Share one classification of pending input between the parser and the
  I/O thread.
2026-10-11 07:20:41 +05:30
Kovid Goyal
f70466f226 Merge PR #10647: Fix input_delay painting twice and using more CPU than input_delay 0 2026-10-11 06:52:40 +05:30
Jesse Miller
b4b0beb20b Start the input stamp on the first byte, and read the clock once
A zero-length commit, from EOF or EAGAIN, no longer sets new_input_at.
The delay is measured from the first real byte.

vt_parser_input_wake() takes the caller's now. The I/O thread reads the
clock once per pass instead of once per child.
2026-10-10 16:18:27 -06:00
Jesse Miller
2bcb49aa04 Simplify the input wake path
These three changes are worth doing because they shorten the wake
decision and remove a second opinion about what is small.

A child exit no longer wakes on its own. The next iteration queues the
child and wakes the main thread, so the old child_closed branch was a
second wake and a second copy of the rate-limit check.

vt_parser_commit_write() no longer returns whether the pending bytes
are small. Nothing read that bool, and the real check is
vt_parser_input_wake().

A small write that already used its early wake, and a signal, share one
rate-limit deadline. The sooner of that slot and a large chunk's own
deadline still wins.
2026-10-10 16:10:51 -06:00
Jesse Miller
17dd8e47ea Skip the held-input paint only in the OS window that owns it
input_held was one flag for the whole process. A background window
waiting out input_delay skipped cursor blink, drags, and swap retries
in every OS window. The flag now lives on the OS window of the held
child. Other windows keep painting. The flag is cleared at the start
of each parse, so a window paints again once its bytes are read.
2026-10-10 16:06:56 -06:00
Jesse Miller
b6694dd51c Wake once per large chunk, and do not count a scanned tail as new input
A large chunk stayed large_ready until the parser cleared its stamp, so
every later read woke the main loop again. Record the stamp on wake and
ignore that chunk until the parser replaces it.

Bytes already scanned and left in the buffer were counted with the next
write. A short write after a large tail waited out input_delay, while
the parser would have taken it immediately. The stamp now stores the
buffer size at that moment, and only bytes committed after it count.
2026-10-10 16:02:17 -06:00
Jesse Miller
e8785ad21b Fix input_delay painting twice and using more CPU than input_delay 0
A large write was scheduled on two clocks. The I/O thread woke the main
loop once the previous wake was input_delay old. The parser then refused
a chunk of at least 1KB until input_delay had passed since its first
byte, and armed a timer for the rest. That first turn still painted:
repaint_delay only skips a paint when nothing was parsed and the last
paint is recent. The timer turn parsed the bytes and painted again right
away, because a turn that parsed input ignores repaint_delay. With both
delays at 1ms this was two trips, and often two paints, per large write.
input_delay 0 never holds, so it did the work once and used less CPU.

The I/O thread now asks the parser for one deadline, new_input_at +
input_delay, and sleeps until then. A chunk under 1KB still wakes
immediately, at most once per input_delay. A buffer within 16KB of full
wakes immediately, which is when the parser already refuses to hold.
If a frame callback or another event wakes the main loop while bytes are
held, render returns without painting. The hold timer is already armed.
A thumbnail still paints. A child that exits is taken off the poll set,
so the hold can no longer see it. The main thread is woken when that
child is queued and flush-parses its final output.

A signal stays latched until that wake. signalfd is emptied on the first
poll, so a later poll cannot see the same signal. Without the latch, a
signal that arrived inside the delay was dropped when the next poll had
no parser deadline.

A scanned tail left in the buffer has its timestamp cleared. Those bytes
were already looked at. They are not input waiting out input_delay.
Treating a zero timestamp as ready made every later wake skip the delay.
If monotonic() returns 0 at startup, the commit stores 1, so 0 stays the
empty timestamp and a real chunk still gets a deadline.
2026-10-10 13:38:38 -06:00
Kovid Goyal
42eb2a1c3b
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
- Anchor the IME cursor rectangle at the column the pre-edit text is
  actually drawn at, which is shifted left of the cursor when the text
  would not otherwise fit on the line, instead of at the cursor column.
- Store the IBus cursor geometry cache per input context rather than in
  a function static, only update it after a successful send and reset it
  whenever a new input context is created.
- Add a test and a changelog entry.
2026-10-10 12:45:19 +05:30
Kovid Goyal
8e3bc050dc Merge PR #10642: Anchor IME cursor rectangle to pre-edit start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 12:37:03 +05:30
Wanten
3bce8cdc36
Anchor IME cursor rectangle to pre-edit start
During IME composition kitty reported the cursor rectangle at the end
of the pre-edit text (overlay_line.cursor_x), so every keystroke that
grew the pre-edit moved the rectangle and the IME candidate window
jumped horizontally.

Report the start of the pre-edit text (overlay_line.xstart) instead,
which is stable for the whole composition, and only send position
updates when it changes. Also deduplicate IBus SetCursorLocation the
same way the Wayland text-input path already does.
2026-10-10 14:37:23 +08:00
Kovid Goyal
b00de8c4bb
more minor fixes inspired by previous PR 2026-10-10 11:29:31 +05:30
Kovid Goyal
bd44b2f4d1 Merge PR #10641: Fix extraction of nested tar hardlinks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 11:19:44 +05:30
Kovid Goyal
1821a5c950
...
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-10 11:06:19 +05:30
Kovid Goyal
be4fef614b
Custom shaders: Query shader source with a parser instead of regexes
Add a small Slang lexer and top level declaration parser to slang.py, and
SlangShaderQuery which runs the slangc preprocessor when an answer could
depend on it. Use it for:

- Detecting pointer_map(), so that comments, #if 0 blocks and calls no
  longer count, macros are honored, and a pointer_map() that is not public
  or does not return float2 is reported instead of failing obscurely. The
  result is cached alongside the pipeline module, so a cached load does
  not run slangc.
- Applying pipeline var directives, which now work for declarations
  spanning multiple lines and match by name as documented.
- Parsing the builtin shaders, with identical results for all of them.

Also cleanup minor issues form previous PR

- Ignore pointer_map() in groups that only draw to part of the screen
- Share the pointer position conversion between glfw.c and mouse.c
- Pass POINTER_MAP_SIZE to the pipeline as a define instead of
  duplicating it
- Do not free the pointer map render target on every pipeline reload
- Document what pointer_map() may depend on and when d.mouse_pos lines
  up with the pointer
2026-10-10 11:04:08 +05:30
Zhizhen He
de1dc36597
Fix extraction of nested tar hardlinks 2026-10-10 13:16:40 +08:00
Kovid Goyal
c75ed19448 Merge PR #10639: Custom shaders: Allow shaders that move content to remap pointer events 2026-10-10 10:41:39 +05:30
Kovid Goyal
be76c8b4a0
... 2026-10-10 10:25:29 +05:30
Kovid Goyal
c53ef1048a
Fix #10627 2026-10-10 10:05:17 +05:30
Kovid Goyal
dea9d877ff
Add a tab bar benchmark to benchmark.py
Times laying out and drawing the horizontal tab bar for every built-in
style with 10, 50 and 200 tabs. Use --compare-with to also time
kitty/tab_bar.py as it is at some git revision.
2026-10-10 09:03:52 +05:30
Kovid Goyal
0e408d502a
Speed up laying out the horizontal tab bar
Laying out the tab bar draws each tab several times, so cache evaluated
title templates for the duration of a single update, unless the template
depends on the length available for the title. Also skip measuring the
overhang of truncated tabs once there is no free space left, as then it
cannot change the layout.
2026-10-10 09:03:43 +05:30
Kovid Goyal
1576898315
Cleanup previous PR
Leave custom draw_tab functions a cell of slack per truncated tab, as
their overhang may grow with the space they are given. Add fade style
tests and a shared helper for horizontal tab bar tests.
2026-10-10 09:03:28 +05:30
Kovid Goyal
7eb0e1877a Merge branch 'pr-10640' 2026-10-10 08:32:53 +05:30
Kovid Goyal
2eae07727b
Make ty happy 2026-10-10 07:39:39 +05:30
Alistair Pattison
f82f4f437b add pr number to changelog entry 2026-10-09 20:12:55 -04:00
Alistair Pattison
094b1a66a5 use all free space in the tab bar for truncated tab titles 2026-10-09 19:59:40 -04:00
Iurii Lunev
30e07a5b09 Custom shaders: Allow shaders that move content to remap pointer events
A shader that draws content away from where kitty put it, such as crt
curving the screen, makes clicks and selections land on the wrong cells,
since kitty maps the pointer to the unmodified cell grid. Up to several
columns near the edges with the bundled crt shader.

Shaders can now define pointer_map(pos, d), returning where the content
shown at pos actually is. kitty renders it into a 64x64 grid when the
pipeline or viewport size changes, reads it back once, and uses it to
move all pointer events. Only always active groups that draw to the
screen are used, since only they move content permanently.

The crt shader defines it, sharing its warp function with fragment_main().
2026-10-09 23:31:29 +03:00
Kovid Goyal
851cb804ff
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-10-09 20:44:09 +05:30
Kovid Goyal
b3112f31a8
Cleanup previous PR
Do not show subtitles by default and fix transcription errors in the
subtitle files: kitty.conf, MIME type, --hyperlink=auto, WeeChat,
switch windows, and use lowercase kitty consistently.
2026-10-09 20:41:46 +05:30
Kovid Goyal
d6cb9084f6 Merge branch 'pr-10630'
# Conflicts:
#	docs/changelog.rst
2026-10-09 20:37:01 +05:30
Kovid Goyal
c406b136cb
Cleanup previous PR
- Only restore entry sizes in the Splits layout resize mode was opened in;
  otherwise fall back to the default reset rather than refusing to reset
- Do not take a snapshot lazily from already resized sizes when resize mode
  was opened in another layout
- Running the resize kitten while its overlay is open replaces the overlay so
  the new options take effect, keeping the original-size snapshot
- Newer edge statuses replace older local messages, and edge failures beep
- Switching strategy no longer discards a --fraction command-line override
- Compute divider room without deep copying the pair subtree
- Fractional resize in other layouts adopts the probed state instead of
  replaying every step
2026-10-09 19:51:38 +05:30
Kovid Goyal
bbe1f53bd6 Merge branch 'pr-10636' 2026-10-09 19:42:48 +05:30
Kovid Goyal
e55d14085a
Cleanup previous PR
- Parse in-band resize reports robustly: require the 48; prefix, accept
  extra parameters and reject negative values instead of panicking
- Handle bracketed paste in parse_input_from_terminal with a dedicated
  scan for the end of paste marker so pasted escape bytes are never lost
- Guard against NaN in scroll_by_pixels and scroll_to_absolute, clamp
  negative absolute scroll targets, let infinite fractional scrolls clamp
  and propagate overflow errors from PyLong_AsDouble
- Empty disk cache entries no longer claim offset 0 in the cache file and
  defrag only moves entries actually written to disk
- Reject zero and too large block sizes in rsync signature headers
- Only replace the encryptor tag once it has been read successfully
2026-10-09 18:37:48 +05:30
Kovid Goyal
4a0fd8d971 Merge branch 'pr-10637' 2026-10-09 18:25:55 +05:30
白鸽
3e0d7b5dbd Format resize remote command and entry tests for CI 2026-10-09 20:34:02 +08:00
白鸽
c0f257f889 Complete resize strategy integration and remove placeholder UI 2026-10-09 20:20:36 +08:00
白鸽
c317e0f1be Restore entry proportions in both Splits resize strategies 2026-10-09 20:05:51 +08:00
白鸽
eeae762225 Add explicit edge resizing for Splits and preserve resize sessions 2026-10-09 19:54:02 +08:00
白鸽
c6bedb393a Add independent resize strategy settings and in-page controls 2026-10-09 19:54:02 +08:00
白鸽
ee7d3d604b Add configurable fractional steps to window resizing 2026-10-09 19:54:02 +08:00
rudolf-blue
6fba92e717 Set an error when getting the AES 256 GCM tag fails 2026-10-09 07:40:56 -04:00