Commit graph

2161 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
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
216c77fdda
Fix #10651 2026-10-11 20:22:52 +05:30
Kovid Goyal
b00de8c4bb
more minor fixes inspired by previous PR 2026-10-10 11:29:31 +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
白鸽
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
cf114eab28 Fix leak of rsync hasher state when parsing the signature header 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
20c24fa4f4 icat: Write unicode placeholders in a single write 2026-10-08 12:00:20 -04:00
Kovid Goyal
c168e31801
Use binary XDG shared MIME database for mimetype lookups
Fixes #3056
2026-10-06 08:27:55 +05:30
Kovid Goyal
033674afea
Fix #10603 2026-10-05 04:16:54 +05:30
Kovid Goyal
0762c21c44
Cleanup previous PR
Use Unicode word boundaries with the stdlib regexp engine

Go's regexp only treats ASCII characters as word characters for \b, while
regexp2 uses Unicode ones, so switching the builtin path pattern to the
stdlib engine changed which paths were marked next to non-ASCII text, for
example config.yaml文件 marked config.yaml. Match against a proxy of the
text in which every non-ASCII rune is replaced by a single ASCII byte that
is a word character iff the rune is one, then map the offsets back.
2026-09-28 06:55:24 +05:30
Kovid Goyal
a6afadb365 Merge branch 'hints-stdlib-regexp' of https://github.com/4RH1T3CT0R7/kitty 2026-09-28 06:53:41 +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
0ceca31ef1 hints kitten: Use Go's stdlib regexp for the builtin patterns
regexp2 backtracks on the path pattern, retrying it at every position
of a long line that has no spaces, so the path and linenum types took
seconds on a screen full of such text (about 36s for a 380x100 window
of hex). The builtin patterns dont need lookarounds, so use the linear
time stdlib engine for them. User supplied --regex patterns stay on
regexp2 so lookarounds keep working (#6265).
2026-09-27 00:09:06 +03:00
Hassan Raza
c7c0f00d0c
Reset SSH extra option state after its value 2026-09-26 22:00:26 +05:00
Kovid Goyal
3aed8ffee3
Merge branch 'perf/word-diff-memory' of https://github.com/4RH1T3CT0R7/kitty 2026-09-26 07:46:59 +05:30
Kovid Goyal
b24ef1f72f
Nicer error handling for failure to launch panels
Fix #10544
2026-09-26 07:37:58 +05:30
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
b6d99a8bcd
Fix #10517 2026-09-23 10:44:08 +05:30
Kovid Goyal
024d34ec8a
Make ty 79 happy 2026-09-08 09:35:54 +05:30
Kovid Goyal
3281919056
ssh kitten: Verify owner and permissions of SHM memory used for askpass
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-01 20:14:03 +05:30
Hassan Raza
9c557f917b
Fix explicit stdin sources in the DnD kitten 2026-08-28 13:19:25 +05:00
Hassan Raza
e31a5e4e07
Fix empty hints selection handling 2026-08-28 11:49:17 +05:00
Hassan Raza
99fb1b8aca
Fix notification close mode 2026-08-28 11:20:05 +05:00
Hassan Raza
1229f19f6d
Restore hints named-group program arguments 2026-08-27 21:55:56 +05:00
Hassan Raza
133aa8bb15
Add independent DnD copy mode 2026-08-27 20:37:01 +05:00
Hassan Raza
e304b3c1d8
Make DnD copies independent 2026-08-27 19:38:23 +05:00
Kovid Goyal
32ea104192
clipboard: Inform clients of too much data
Fixes #10399
2026-08-25 09:19:46 +05:30
Kovid Goyal
b60a8d333e
Fix remote path sanitisation 2026-08-24 18:37:15 +05:30
zaveshaa
e01b09c557 Fix a few typos in the docs and the choose_files kitten help text 2026-08-24 14:58:48 +03:00
Kovid Goyal
4fd834a5e7
... 2026-08-20 08:07:21 +05:30
OBrutus
19a0bf0670 Merge origin/master into go-kitten-ports
Reconcile the three ported kittens with 529 upstream commits. Only conflicts
were in the shrunk resize_window/broadcast/remote_file main.py stubs (upstream
reformatted their OPTIONS strings); resolved by keeping upstream's formatting
plus the Go-port stubs (shrunk main, remote_file handle_result shim, dropped
-h alias). Go build + kitten tests pass; dev build regenerates CLI cleanly;
Python suite at baseline (1 pre-existing unrelated failure).
2026-08-18 16:18:54 +05:30
OBrutus
49c0117339 remote_file/broadcast/resize_window: untrack generated CLI files, drop dead ToLower, document -h removal 2026-08-17 15:16:50 +05:30
OBrutus
344d45d694 remote_file kitten: reset terminal before top-level error display
main()'s error path after handle_action fails (e.g. malformed
--ssh-connection-data, or a ControlMaster connect failure) was missing the
reset_terminal() call Python's equivalent except-path makes
(kittens/remote_file/main.py pre-shrink: `except Exception: print(reset_terminal(),
...); traceback.print_exc(); show_error(...)`). Without it, the error rendered
over the stale ask-menu screen instead of a clean one. Added reset_terminal()
before show_error(), matching the other four call sites already added for
this kitten.

Verified: launched `kitten remote-file --path /nonexistent --hostname x
--ssh-connection-data 'not-json'` in a disposable kitty instance, selected an
action to trigger the parse failure, and confirmed via `get-text`/`get-text
--extent=all` that only the error message is present -- no ask-menu leftovers.
2026-08-14 12:41:25 +05:30
OBrutus
a0978a74a2 remote_file kitten: port ask UI to Go, wrap and shrink Python to result-handler shim
Adds kittens/remote_file/main.go (ask menu, hostname-mismatch prompt,
save-path prompt with tab completion, edit/open/save actions) on top of the
ControlMaster/ssh helpers from the previous two commits, registers it in
tools/cmd/tool/main.go, and adds remote_file to shell-integration/ssh/kitty's
wrapped_kittens list so both `kitty +kitten remote_file` and ssh-session
invocations exec the Go binary directly. main.py is shrunk to option_text
(kept importable by kitty/cli_stub.py and used for --doc/--help generation),
is_ssh_kitten_sentinel (kept importable by kitty/window.py), and the
handle_result shim boss.py runs in-process to open the returned file.

Also drops the dead `-h` alias on --hostname: Python's CLI layer always
special-cases -h/--help ahead of user options, so it never worked as a
hostname shorthand, but the Go CLI layer hard-errors on the collision; removing
it is a no-op for existing behavior (boss.py only ever passes --hostname) and
unblocks `kitten remote-file --help`. Also adds the same reset_terminal()
calls Python makes between UI phases (ask menu -> action, hostname-mismatch
prompt, overwrite prompt, $EDITOR handoff) so the Go and Python screens match.

Manually verified parity against Python (ask menu, cancel, open/edit/save
download+upload round-trips, hostname-mismatch Y/N, save-path prompt and
overwrite O/A/R/N) using a fake-ssh test double, and confirmed post-wrap that
`kitty +kitten remote_file` execs the Go kitten binary.
2026-08-13 15:21:57 +05:30
OBrutus
36f93e72a7 remote_file kitten: Go control master, download/upload, edit loop 2026-08-12 18:02:57 +05:30
OBrutus
062ff5fed1 remote_file kitten: correct pythonSplitExt to match os.path.splitext semantics 2026-08-12 17:50:13 +05:30
OBrutus
f9e242e308 remote_file kitten: fix dotfile rename and ssh-kitten cmdline truncation edge cases 2026-08-12 17:45:35 +05:30
OBrutus
25c3347d38 remote_file kitten: Go connection-data parsing and ssh helpers 2026-08-12 16:32:53 +05:30
OBrutus
7e5c773df1 broadcast kitten: wrap as Go kitten, remove Python implementation 2026-08-12 16:04:03 +05:30
Kovid Goyal
cc51e89f22
Make ty happy 2026-08-12 15:07:11 +05:30
Hassan Raza
81791a090f
Quote choose-files shell output safely 2026-08-12 13:10:53 +05:00
OBrutus
aa8bf26b02 broadcast kitten: Go TUI implementation and registration 2026-08-12 12:52:40 +05:30