Commit graph

1514 commits

Author SHA1 Message Date
Kovid Goyal
2d3ff7b240
Support detailed wheel events in the kittens framework
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
Kittens can opt in with Loop.DetailedWheelEvents(), after which scroll
events arrive as MOUSE_WHEEL mouse events whose Wheel field has the
deltas, unit, multiplier, source, phase and momentum/inverted flags.
WheelEvent.Lines() converts the deltas to lines using the terminal's
multiplier when available.

The mouse-demo kitten uses this to move a block drawn with the graphics
protocol up and down with pixel precision, falling back to wheel button
presses in terminals without support, and shows the event details.
2026-11-16 13:43:41 +05:30
Kovid Goyal
bf37d5841b
benchmark kitten: Add scrollback and render benchmarks and --output
Replace the --with-scrollback and --render flags with two new
benchmarks, scrollback and render, that use the ASCII text with the
main screen and with rendering allowed, respectively. All other
benchmarks use the alternate screen with rendering suppressed. Add an
--output flag to also write the results to a file as JSON and list the
available benchmarks with descriptions in the help text.
2026-11-16 13:43:40 +05:30
Kovid Goyal
c9a99c093d
Make the ASCII and Unicode text benchmarks comparable
The two benchmarks now use text with the same structure: the same lines,
of the same widths in cells, ending in CRLF and with tabs at the same
positions, differing only in the characters used to fill them. Before,
the ASCII text had a bare newline about every 90 bytes, while the
Unicode text was long lines of mostly CJK text, so they were dominated
by different costs. Also report the rate at which cells are drawn for
them, since non-ASCII characters are encoded in more bytes.
2026-11-16 13:43:40 +05:30
Kovid Goyal
e7597bc443
benchmark kitten: Add benchmarks for text with many distinct colors
Add truecolor_text, where every char has a random 24-bit foreground,
palette16_text, the same but with only 16 distinct colors, and
halfblocks, rows of half blocks with random 24-bit foreground and
background as written by terminal image viewers.

The existing benchmarks use either no colors or a handful of fixed
SGR codes, which favors terminals that store styles in a per page
deduplicated table rather than in each cell. These benchmarks measure
the cost of output with many distinct styles, which is common in
practice.
2026-11-16 13:43:39 +05:30
Kovid Goyal
add52d9cf7
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
Normalise the cwd passed to CompleteFiles once, so that a relative cwd,
such as a config directory from a relative XDG_CONFIG_HOME, no longer gets
joined onto itself twice. This also removes the second resolution pass
against cwd and the absolutize_path helper. Check for errors in the test
setup and test relative, ../ and ~/ prefixes against a custom cwd as well
as a relative cwd.
2026-11-14 08:29:17 +05:30
Kovid Goyal
2b47a83a0d
Merge branch 'pr-10863' 2026-11-14 08:27:24 +05:30
Kovid Goyal
d8f96a7d0a
Unicode input kitten: Fix searching by name not finding some characters
The word filter for control characters was applied to the record index
instead of the codepoint, dropping the words for ~160 characters.

Fixes #10862
2026-11-14 08:23:25 +05:30
devangpratap
30e7f3512e Complete paths relative to the config directory correctly
CompleteFiles resolved the prefix with filepath.Abs, which uses the
process cwd, instead of the cwd it was given. For the completers that are
relative to the config directory, like kitty --session and launch
--watcher, a prefix such as sessions/ was looked up under the shell's cwd,
so completing inside a sub-directory of the config directory gave nothing,
or the contents of a same named directory in the shell's cwd. Resolve
relative prefixes against the given cwd instead.
2026-11-12 16:40:55 -05:00
Kovid Goyal
6d8f7ac14f
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
Let preview renderers supply extra cache key data instead of checking for
the cmd_renderer type. Include the command line in the key for custom
previews and the video_preview settings in the key for video thumbnails,
so that changing them no longer shows stale previews. GetPath and AddPath
now take this extra key data, replacing GetPathWithAlias.

Track the entry each path uses per extra key, so that previews of one file
with different settings do not evict each other. Do not remove an entry
while another path, such as another symlink to the same file, still uses
it. Cache hits are now recorded so that such shared entries are known.
Failing to remove an orphaned entry on a cache hit no longer turns the hit
into an error.

Fix ensure_entries() discarding unwritten changes when the entries file
does not exist yet, which lost the first path recorded in a new cache.
Also reset the path map when clearing the cache.
2026-11-11 21:26:01 +05:30
Zhizhen He
a1f5604cc2
choose-files: Keep custom preview caches separate for symlinks
Custom preview commands receive the selected path. Include that path
in their cache key so that symlinks to the same file can have different
previews. Keep the resolved target in the key so retargeting a link
still invalidates its entry.
2026-11-11 23:32:42 +08:00
Kovid Goyal
67c6d243c4
Fix animated mouse pointers restarting on every mouse move
The mouse-demo kitten popped and pushed the pointer shape on every mouse
event, and kitty applied each OSC 22 to the OS pointer immediately, so the
pointer briefly flipped to the default shape and back, restarting
animations. Only change the shape in the kitten when it actually changes,
and apply pointer shape stack changes to the OS pointer once per batch of
parsed child output.

Also have ApplyHoverStyles replace the current shape instead of pushing a
new one, so the shape stack does not grow as the mouse moves between
regions.

Fixes #10838
2026-11-10 08:49:23 +05:30
Kovid Goyal
f0286492d5
set-colors: Accept cursor_text_color background in color files
The Go client rejected the value, even though kitty.conf and the old Python
client accept it and treat it as None. Fixes #10832
2026-11-10 08:24:47 +05:30
Egor Ignatov
0b1b477409 Fix special color encoding on 32-bit platforms
Use int64 for encoded special colors so RGB values shifted into the
upper three bytes remain positive on 32-bit platforms, while preserving
the negative sentinel values used for macOS titlebar colors.

Update the tests to use the same type, avoiding overflowing int constants
when compiling them on 32-bit platforms.
2026-11-09 13:01:06 +03:00
Kovid Goyal
8f5c7544d1
Bash integration: Source the system startup files bash was built with
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
bash is compiled with the paths to its system wide profile and bashrc
(SYS_PROFILE and SYS_BASHRC) and there is no way to query bash for them.
Previously kitty guessed locations in /etc, which fails on distros that
keep these files elsewhere, such as hermetic /usr distros like Clear Linux
(/usr/share/defaults/etc) or Nix (/etc/bashrc).

Now find the paths by scanning the bash executable for them, both in kitty
and in kitten run-shell (so it works on remote hosts via the ssh kitten).
The result is cached per executable in kitty. If the scan fails, or the
locations are explicitly specified via the environment, the previous
behavior is used.

Fixes #10819
2026-11-07 06:25:36 +05:30
Marcel van der Boom
0853019e59 tty: take the TCSETS ioctl numbers from x/sys/unix
The hard-coded 0x5402/0x5403/0x5404 are the x86 (generic) values. On
powerpc TCSETS, TCSETSW and TCSETSF are 0x802c7414..6, so Tcsetattr
failed with ENOTTY and every kitten that sets terminal modes exited
at once: on ppc64le the paste confirmation (kitten ask) only flickered
and the paste was dropped. x/sys/unix defines the right value per
architecture, as already used for TCGETS in Tcgetattr and for
TIOCSETA* in tty_bsd.go. Drop the rest of the constant block too:
copied from pkg/term, unused, and also x86-only.

Verified on ppc64le: kitten ask under script(1) failed with
"inappropriate ioctl for device" (strace: ioctl 0x5402 = -ENOTTY);
with this change the TCSETS ioctl succeeds and the prompt runs.
2026-11-03 11:03:09 +01:00
Kovid Goyal
02dd29ad14
Add nightly version to version string for nightly builds. Fixes #10751 2026-10-27 10:43:51 +05:30
Kovid Goyal
52d33e2c82
zsh completion: Respect the descriptions format style for group headings
Previously group headings were hard-coded as %B<title>%b, ignoring the
user's zstyle ':completion:*:descriptions' format. This caused literal
%B/%b markers to appear with fzf-tab. Now the configured format is used,
falling back to bold titles when none is set.

Fixes #10748
2026-10-26 16:31:39 +05:30
Kovid Goyal
debcde56c0
Cleanup dangling symlink handling in atomic writes
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
Move EvalSymlinksThatExist to paths.go as it is no longer used only for
tar extraction, create the test symlinks in a deterministic order and
add a changelog entry for #10740 noting that it affects all atomically
saved files, not just clipboard output.
2026-10-25 22:23:27 +05:30
Zhizhen He
7fdd2af0fc
clipboard: Preserve dangling output symlinks 2026-10-25 22:21:52 +05:30
Kovid Goyal
1fee9e89f6
ssh kitten: Allow per-host color schemes for dark and light mode
New color_scheme_dark, color_scheme_light and color_scheme_no_preference
options. When any of them is set, the ssh kitten sends the color schemes
for all three system color schemes to kitty, which applies the one
matching the current system color scheme and switches between them when
the system color scheme changes. color_scheme is used for modes without
a specific color scheme.

The colors are applied in a new session color layer, above the colors of
the window and below colors set by programs. They are associated with the
color stack entry pushed by the ssh kitten and are removed when it is
popped, so nested sessions work and the colors are restored on exit.

Configs that only use color_scheme continue to use escape codes exactly
as before, as does the kitten when running inside tmux.

Fixes #10724
2026-10-23 09:37:50 +05:30
Kovid Goyal
8e4780f8ec
Fix crash with damaged images in set-window-logo/set-background-image
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
image.Decode failures fell through to encoding a nil image, causing a
panic. Read the image into memory instead of streaming from an open file,
which also fixes file descriptors leaking on the DecodeConfig error path
and for PNG images, which were never closed. Include the path in decode
errors and drop the wasteful raw RGBA sized buffer preallocation.

Closes #10715
2026-10-21 22:38:43 +05:30
Kovid Goyal
f9bd7c2085
set-spacing: Accept the *-horizontal and *-vertical edge names in kitten @
The Go parser had its own copy of the edge name mapping, which had drifted
from the Python one. Generate the Go mapping from the Python one so there
is a single source of truth, and share the documentation of the spacing
syntax between set-spacing and launch --spacing, documenting the long
forms.

Closes #10712
2026-10-21 10:20:35 +05:30
Kovid Goyal
8da5bf3f7c
set-colors: Fix encoding of colors with special values in the Go client
wayland_titlebar_color, macos_titlebar_color, scrollbar_handle_color and
scrollbar_track_color store a special value in their lowest byte with
actual colors shifted into the upper bytes. The Go client sent them as
plain RGB values, so kitty interpreted the blue component as the special
value, for example, scrollbar_track_color=#ff0000 used the foreground
color. It also rejected special values such as background and dark.

Encode them the same way as the Python parsers do.
2026-10-20 07:39:42 +05:30
Kovid Goyal
48674a7869
set-colors: Clean up parsing of colors and conf files
Pass the CLI options to parse_colors_and_files instead of reading
global state, and have it set all and configured when reset is
specified, matching the Python client.

Read conf files with the standard config parser so that tabs,
indentation, long lines and include directives work, and report
invalid colors instead of silently ignoring them. Non-color settings
and special values of colors such as wayland_titlebar_color are still
ignored, as in the Python client.

Allow special_parse functions to take over fields that are backed by
options in the generated Go remote control code.
2026-10-20 07:32:15 +05:30
Zhizhen He
de43c108f5
set-colors: Ignore color arguments when resetting colors
Skip color argument parsing for --reset, as documented and already done
by the Python command path. Add a payload-creation regression covering
invalid colors, missing files and valid colors with and without reset.
2026-10-20 00:54:13 +08:00
Kovid Goyal
9a8c61d402
set-background-opacity: Reject NaN and improve the invalid opacity error
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
Go's min/max propagate NaN, so "nan" got past parse_opacity and failed
later with an unclear json.Marshal error, while the Python parser
silently clamped it to 0. Reject NaN in both, report a clear error
message for invalid opacity values, and replace the regression test with
a table test of parse_opacity covering clamping and invalid inputs.
2026-10-19 21:36:00 +05:30
Zhizhen He
5f5ae32753
set-background-opacity: Reject invalid numeric arguments
Return ParseFloat errors instead of silently treating malformed input as zero opacity. Add a payload-creation regression and changelog entry.
2026-10-19 23:42:39 +08:00
Hassan Raza
a77b763960
Cover missing values after grouped and repeated options 2026-10-18 11:47:32 +05:00
Hassan Raza
608e46be33
Reject options whose required value is missing 2026-10-18 11:46:17 +05:00
Hassan Raza
b1df817c44
Cover missing values on CLI option aliases 2026-10-18 11:45:33 +05:00
Kovid Goyal
f426c08f5d
Apply deferred directory permissions children first when extracting tar
A parent directory without search permission prevents changing the
permissions of its children, so apply the deferred chmods in reverse
order, as GNU tar does. Also add a test and changelog entry for #10676.
2026-10-16 19:12:51 +05:30
devangpratap
6e41991430 Fix extracting tar archives with read-only directories 2026-10-16 09:26:26 -04:00
Kovid Goyal
535c7502e8
Graphics protocol: Add indexed color image formats
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
Add two new image formats, f=8 with one byte per pixel that is an index
into the terminal color palette and f=16 with a palette index followed by
an alpha byte. Indices 0-247 are the SGR 256 color table entries and
248-255 are special colors: default background, default foreground,
selection background and foreground, cursor, cursor text, URL color and
one reserved slot. Such images change color automatically when the
terminal colors change.

The images are uploaded as integer textures and drawn by a separate
shader program that looks up colors in the existing per window color
table uniform block, so a color scheme change costs nothing extra and
rendering of normal images is unaffected. Programs are switched only at
boundaries between runs of indexed and normal images in draw order. The
shader does bilinear filtering after the palette lookup since integer
textures cannot be filtered. Animation and frame composition are not
supported for these formats.

Closes #10666
2026-10-15 22:05:23 +05:30
Kovid Goyal
32a77d3cf7
Fix colors 16-255 being set to white by ssh and themes kittens when theme leaves them unset
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
Fixes #10661
2026-10-13 14:03:22 +05:30
Kovid Goyal
ed0d236708
Program status protocol: fixes and improvements
- Use the SIMD base64 decoder
- Allow ids of up to 263 bytes, the 128 byte limit in the spec is an error
- Drop transient records when a program run with launch --hold exits, even without shell integration
- Drop done and error records when a key is pressed in the window
- Only build the records list when there are watchers
- Count the raw bytes of a report against the length limit
- Strip only ASCII whitespace and discard reports with over long keys regardless of case
- Identical reports do not change which record is shown in the tab bar
2026-10-13 08:50:39 +05:30
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
Zhizhen He
d91ab369e4
Fix locking during concurrent disk cache access 2026-10-11 12:56:24 +08:00
Kovid Goyal
b00de8c4bb
more minor fixes inspired by previous PR 2026-10-10 11:29:31 +05:30
Zhizhen He
de1dc36597
Fix extraction of nested tar hardlinks 2026-10-10 13:16:40 +08:00
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
rudolf-blue
ba21f4a74a Fix division by zero when the terminal reports a zero size 2026-10-09 07:40:55 -04:00
Kovid Goyal
fb68ed81e0
Fix #10634
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 13:53:34 +05:30
rudolf-blue
799963bc38 Dont leak the reader goroutine in roundtrip_to_terminal 2026-10-08 12:00:20 -04:00
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
devangpratap
632265ec33 Do not stay in the escape state after a backslash-newline in StringLiteral
The empty case '\n' in the backslash state was meant to drop a
backslash-newline pair like Python's python_string does, but it never
reset the state, so the next character was parsed as an escape.
2026-09-29 12:27:24 -04:00
Kovid Goyal
5f05ab7e00
Merge branch 'perf/subseq-dp' of https://github.com/4RH1T3CT0R7/kitty 2026-09-26 07:55:16 +05:30
devangpratap
65f857a39a choose-files: Do not crash on a bare "!" line in an ignore file 2026-09-25 14:36:37 -04:00
Artem Lytkin
ef1c0fd416 subseq: Score matches with dynamic programming
score_item tried every combination of positions of the needle chars in the
item, which is exponential in the length of the query. Typing the full name
of a theme like "Solarized Dark Higher Contrast" in the themes kitten froze it
for about half a minute.

Instead find the best score for each position of each needle char from the
best scores for the previous char. The per char scores are added in the same
order as before, so the scores are bit for bit identical. When several sets
of positions have exactly the same score, the highlighted positions can be
different from before.
2026-09-25 16:46:19 +03:00
devangpratap
bd3eb4c267 Completion: Do not emit multi line candidates for fish
fish splits the output of the completion function on newlines to build
the candidate list, so an option whose help text spans paragraphs added
its continuation lines as candidates of their own. Build the candidate
with the newline replacement the fish2 branch already used, so both
paths agree.
2026-09-24 14:48:28 -04:00