Commit graph

292 commits

Author SHA1 Message Date
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
b00de8c4bb
more minor fixes inspired by previous PR 2026-10-10 11:29:31 +05:30
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
Artem Lytkin
f6e276c1e7 diff kitten: Fix search missing matches at the end of a line
find_matches_in_lines was passing the exclusive end offset of a match to
find_pos, so a match ending at the end of the joined screen lines mapped
to no line and was dropped. It was not highlighted, not counted and n/N
skipped it. Since screen lines are not padded, this hit any match on the
last character of a line, for example searching for foo in "x := foo".

Look up the line holding the last matched byte instead.
2026-09-27 12:39:13 +03:00
Artem Lytkin
8e194d8e67 diff kitten: Don't build a full LCS table for word diffs of long lines
word_diff_center filled an (m+1)*(n+1) table of ints for the differing
middle of every changed line pair. For a 100 KB line of minified
JavaScript with a word inserted near each end that is 2.6 GB and over
two seconds, and compute_centers runs the line pairs in parallel.

Changed words are only highlighted when they pair up by position, which
needs the same number of words on both sides, so return changed_center
right away when the counts differ. The output is the same as before in
that case. Lines with equal word counts but more than 2048 words between
the first and last changed word now get the central highlight too
instead of a huge table, and the table uses int32.
2026-09-25 21:41:23 +03:00
Kovid Goyal
7f0b072f0d
autoformat 2026-08-05 05:32:56 +05:30
Kovid Goyal
e6e5524f67
diff kitten: Strip suid/sgid bits from extracted files 2026-06-03 05:45:04 +05:30
Kovid Goyal
a3dfe2b55a
Make sticky_header default to yes 2026-04-19 12:14:39 +05:30
Petar Dobrev
4f5698a5a2 fix overlap with the next file's header 2026-04-19 09:24:44 +03:00
Petar Dobrev
7729e6e1ae kitten diff: add support for sticky header 2026-04-18 18:26:30 +03:00
Павел Мешалкин
8ffdf7d7ee feat: add per-mapping --allow-fallback for layout-independent shortcuts
Add --allow-fallback option to the map command that controls shifted
and ascii (alternate_key) fallback for individual key mappings.

For non-Latin keyboard layouts, when the current layout key is
non-ascii (codepoint > 127 and < 0xE000), the alternate_key from
the base layout is used for matching if the mapping opts in via
--allow-fallback=shifted,ascii.

Default kitty bindings use --allow-fallback=shifted,ascii so they
work out of the box with non-Latin layouts. User custom mappings
default to --allow-fallback=shifted (preserving existing shifted_key
behavior without ascii fallback).

--allow-fallback=none disables all fallback for a mapping.

Python side: parse_options_for_map() in options/utils.py handles flag
parsing, ShortcutMapping uses it in __init__. get_shortcut() filters
candidates by per-mapping allow_fallback.

Go side: ParseMap() handles --allow-fallback, KeyAction stores
AllowFallback, ShortcutTracker.Match passes it to matching.
MatchesParsedShortcut defaults to shifted,ascii for hardcoded shortcuts.

Migrated kittens (themes, command_palette, diff, choose_files) to
use ShortcutTracker with configurable map entries.

Tests added for Python (5 test methods) and Go (ParseMap + key matching).
2026-03-25 19:34:13 +03:00
Kovid Goyal
eddaaed3e3
Modernize Go code 2026-03-21 08:41:47 +05:30
Kovid Goyal
01a70e06c4
... 2026-03-12 13:53:41 +05:30
Kovid Goyal
0614f05335
Use new SIMD function for non blank checking 2026-03-12 13:50:35 +05:30
Kovid Goyal
d8af7e2c88
Add an option to control highlighting of moved lines 2026-03-12 12:59:46 +05:30
copilot-swe-agent[bot]
f45345c7a7
Add colorMoved support to kitty diff kitten
Fixes #3241
Fixes #9644
2026-03-12 12:44:21 +05:30
Kovid Goyal
d15905c918
Change default word regexp to exclude punctuation 2026-03-04 09:20:53 +05:30
copilot-swe-agent[bot]
1785873835
diff kitten: Use a words based algorithm for intra line changed region highlighting
Fixes #9598
2026-03-04 09:06:37 +05:30
Kovid Goyal
a1927eb662
DRYer 2026-02-25 09:11:04 +05:30
Kovid Goyal
b26d0b6ac5
Add more text file types to kitten diff completion
Fixes #9556
2026-02-25 08:57:54 +05:30
Kovid Goyal
6f588a0c29
run modernize 2025-11-11 17:09:37 +05:30
Kovid Goyal
f067e9cd92
Make various goroutines panic-safe 2025-10-09 07:17:53 +05:30
Kovid Goyal
9a4b52f8b9
diff kitten: Fix wheel_scroll_multiplier not being respected
Fixes #9054
2025-10-01 17:07:47 +05:30
Kovid Goyal
ecf7f0cab0
kitten diff: Fix incorrect rendering if diff completes before terminal responds to capabilities query 2025-09-02 11:29:55 +05:30
Kovid Goyal
fd5876b94e
Use SIMD to replace C0 control codes in Go code 2025-07-21 08:54:22 +05:30
Kovid Goyal
28fce006d6
Make highlight code fully re-useable 2025-07-20 15:37:03 +05:30
Kovid Goyal
9068bbaba9
Make code to highlight file re-useable 2025-07-20 10:32:31 +05:30
Kovid Goyal
d1faccdd1c
Loop API print proper stack traces for panics in go routines 2025-06-01 12:51:59 +05:30
Kovid Goyal
c861259e3b
Rename go module from kitty -> github.com/kovidgoyal/kitty
Makes the code more easily re-useable in other projects
2025-05-16 08:43:39 +05:30
Kovid Goyal
b5cbb501a4
Use the base name of the named pipe for the created temp file 2025-05-03 16:03:06 +05:30
Kovid Goyal
7ef2fe53e0
Avoid extra stat() 2025-05-03 15:55:36 +05:30
Kovid Goyal
a59a347903
diff kitten: Allow diffing named pipes
Fixes #8597
2025-05-03 15:53:29 +05:30
Kovid Goyal
e42d410ee4
Move cli spec parsing code into simple module 2025-04-28 09:20:10 +05:30
Kovid Goyal
4b4bfca007
... 2025-04-06 09:16:42 +05:30
bilbofroggins
2d462b40b7
Update ui.go 2025-04-05 19:24:17 -04:00
bilbofroggins
fd14e103ef
Update main.py 2025-04-05 19:21:38 -04:00
Kovid Goyal
da1626090a
Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
081c061538
Clarify prefix usage 2025-01-16 11:52:37 +05:30
Kovid Goyal
7a9e5d9dcb
... 2025-01-16 11:50:43 +05:30
Kovid Goyal
2dc6300f55
Fix #8205 2025-01-09 11:29:31 +05:30
Kovid Goyal
2d02ff1c5f
Implement using effective kitty config options for kittens
Also centralise reading of kitty options
2025-01-05 20:16:43 +05:30
Kovid Goyal
f3db7e7554
diff kitten: Automatically change colors on terminal color scheme change 2025-01-05 06:00:24 +05:30
Kovid Goyal
98c1e0f7aa
Allow reusing the token from chroma lexer 2025-01-04 17:20:08 +05:30
Kovid Goyal
e34a899ea6
diff kitten: Automatically use dark/light color scheme based on the color scheme of the parent terminal
Fixes #8170
2025-01-04 12:57:33 +05:30
Kovid Goyal
134271be93
diff kitten: Abort when run inside a terminal that does not support the kitty keyboard protocol
Fixes #8185
2025-01-03 21:34:38 +05:30
Jackie Li
2208b3be3a
diff kitten: fix mouse move down up selection 2024-10-23 19:12:25 +01:00
Kovid Goyal
8eb0b556b7
diff kitten: Fix a regression that broke diffing against remote files
Fixes #7797
2024-08-28 11:00:42 +05:30
Jackie Li
bbe29dbc7b
[diff kitten] move next/prev file 2024-07-31 16:11:38 +01:00
Kovid Goyal
405f5ce148
Use stdlib maps/slices 2024-06-24 07:54:13 +05:30