Commit graph

2136 commits

Author SHA1 Message Date
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
OBrutus
59438927a9 broadcast kitten: Go send-text/session escape-code helpers 2026-08-11 17:24:52 +05:30
OBrutus
9cffe48359 resize_window kitten: wrap as Go kitten, remove Python implementation 2026-08-11 17:16:05 +05:30
OBrutus
edbf66f004 resize_window kitten: Go TUI implementation and registration 2026-08-11 00:27:05 +05:30
OBrutus
9e34cad010 resize_window kitten: Go RC escape-code helper 2026-08-06 19:24:28 +05:30
Kovid Goyal
2af2d313de
autoformat c/objc code, using clang-format with left alignment for line continuation chars 2026-08-05 19:37:00 +05:30
Kovid Goyal
4c6467814b
autoformat c/objc code, using clang-format 2026-08-05 19:10:55 +05:30
Kovid Goyal
7f0b072f0d
autoformat 2026-08-05 05:32:56 +05:30
Kovid Goyal
c04ce11a74
Desktop file chooser integration: when the specified directory does not exist, open file chooser at home directory
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 #10292
2026-07-28 09:04:57 +05:30
Kovid Goyal
a08b27e0c1
autoformat 2026-07-26 22:08:55 +05:30
Kovid Goyal
9dca948e9b
Restrict echo to only allow characters 0-9
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-07-26 16:05:13 +05:30
Kovid Goyal
15a44edefc
Clean up previous PR 2026-07-09 07:01:18 +05:30
qo0u0op
ead0836c5d feat(quick-access-terminal): make --layer configurable 2026-07-09 02:18:03 +08:00
Hector Tellez
501f28acdf Fixes bug where hints starting with the first alphabet's character are _almost never_ generated.
* Switches to "positional notation" to fix the bug.
* Consolidates `encode_hint` and `generate_prefix_free_hint` into `encode_hint`.
* Moves prefix_free_hints.go to hints_generator.go; `encode_hint` and `decode_hint` were moved here too.
* The "prefix-free" logic was made 0-index based instead of 1-index based for two reasons:
  1. To simplify 1-off discrepancies.
  2. To keep backwards compatibility with the old usage of `encode_hint`.
* Slight perfomance improvement added by reusing the runt-to-index map instead of rebuilding for each call to `decode_hint`.
* Unit tests added; for all new logic and old affected logic.

Fixes #10231
2026-07-07 02:07:51 -07:00
Kovid Goyal
5ca4805b43
Fix text overflow in choose files search box caused by move to readline 2026-07-05 18:01:42 +05:30
Kovid Goyal
011ef4d319
Use readline for the choose files search input 2026-07-05 15:16:11 +05:30
Kovid Goyal
3cee91f00b
Merge branch 'master-choose-files' of https://github.com/Mr7F/kitty 2026-07-04 13:18:52 +05:30
Kovid Goyal
facec19834
Cleanup previous PR 2026-07-04 12:52:34 +05:30
Kovid Goyal
c64ff282d0
Merge branch 'master' of https://github.com/tellezhector/kitty 2026-07-04 12:41:38 +05:30
Kovid Goyal
a65b4c70a7
Migrate type checker to ty
Much faster than mypy. Matches usage of ruff from same developer.
2026-07-04 09:18:00 +05:30
Mr7F
b2edb4b12d [IMP] choose-files: allow selecting files and directories
Add a new mode `all` to select either a file or a directory.
2026-07-03 21:02:08 +02:00
Hector Tellez
5d1215b11d Implements option to generate prefix-free hints
- Declares --prefix-free CLI flag in main.py.
- Implements dynamic index offset shifting in marks.go to prevent
  generating hints that prefix other hints.
- Integrates prefix-free encoding in main.go.
- Includes tests.

Implements #10195
2026-07-01 09:24:30 -07:00
Forrest
83677a2235 fix(choose-fonts): guard preview rendering against partial terminal color query
The choose-fonts kitten queries the terminal for the user's foreground and
background colors at startup by sending a DCS request. The terminal responds
with separate DCS response strings — one per field — which arrive
asynchronously through on_query_response.

The background handler unconditionally called draw_screen() after storing its
value. If the terminal's DCS response for "background" arrived before the
response for "foreground", draw_screen() fired with text_style.Foreground
still at its Go zero value ("").

The font list preview (list.go) only guarded against empty Background, not
empty Foreground, so it passed the check and sent a render_family_samples
command to the Python backend with foreground="". The backend's to_color('')
raised ValueError: Invalid color name: '', crashing the kitten.

The faces pane (faces.go) launched a render_family_samples goroutine
unconditionally when its preview cache was empty, with no guard at all.

Fix
---
1. ui.go — Only trigger draw_screen() from the foreground or background
   handler when the counterpart field is already populated, so the UI
   never renders with a partial TextStyle.

2. list.go — Require both Foreground and Background to be non-empty
   before rendering the font preview, not just Background alone.

3. faces.go — Skip the render_family_samples goroutine if either color
   field is still empty. The preview cache stays empty, so the next
   redraw (triggered when the counterpart query response arrives, or
   by on_wakeup) retries with full colors.
2026-06-10 02:18:18 -07:00
Kovid Goyal
45bd3a0f14
Add a note about interaction of --reload-in and auto reload 2026-06-07 08:55:48 +05:30
Kovid Goyal
8996aa798c
dnd kitten: Create regular files with O_EXCL to avoid symlink attacks
Some checks failed
CI / Linux (python=3.13 cc=clang sanitize=1) (push) Has been cancelled
CI / Linux (python=3.11 cc=gcc sanitize=0) (push) Has been cancelled
CI / Linux (python=3.12 cc=gcc sanitize=1) (push) Has been cancelled
CI / Linux package (push) Has been cancelled
CI / Bundle test (macos-latest) (push) Has been cancelled
CI / Bundle test (ubuntu-latest) (push) Has been cancelled
CI / macOS Brew (push) Has been cancelled
CI / Test ./dev.sh and benchmark (push) Has been cancelled
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (c, macos-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Has been cancelled
Depscan / Scan dependencies for vulnerabilities (push) Has been cancelled
This is not really needed as the terminal emulator should be de
duplicating directory entries anyway but no harm in defense in depth.
2026-06-03 12:17:38 +05:30
Kovid Goyal
e6e5524f67
diff kitten: Strip suid/sgid bits from extracted files 2026-06-03 05:45:04 +05:30