Commit graph

525 commits

Author SHA1 Message Date
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
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
Kovid Goyal
b6d99a8bcd
Fix #10517 2026-09-23 10:44:08 +05:30
Kovid Goyal
fb99338101
also ask for cursor position on benchmark data completion to ensure terminal has updated its state 2026-08-29 03:02:56 +05:30
Kovid Goyal
302399681c
Make benchmark warmup more sophisticated by allocating a few thousand colors as well 2026-08-29 02:58:15 +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
Kovid Goyal
db36f6b9b6
Increase default number of reps for benchmarking 2026-08-18 08:22:46 +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
aa8bf26b02 broadcast kitten: Go TUI implementation and registration 2026-08-12 12:52:40 +05:30
OBrutus
edbf66f004 resize_window kitten: Go TUI implementation and registration 2026-08-11 00:27:05 +05:30
Kovid Goyal
3f16b01e80
Also handle leading ~ 2026-08-05 05:32:55 +05:30
Kovid Goyal
f156c3c152
Handle relative paths for the screenshot rc command correctly 2026-08-05 05:32:55 +05:30
Kovid Goyal
766466ad57
Add a screenshot remote control command 2026-08-05 05:32:55 +05:30
Sinity
ed51a3e97c
Benchmark unique multi-codepoint Unicode cells
Add a benchmark stream containing 262,144 distinct base-plus-combining-mark cells per repetition so TextCache collection cost remains visible instead of collapsing into cache hits.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-12 15:27:24 +02:00
Kovid Goyal
d5cac0100e
Fix remote_control_script not working in a kitty instance run from inside another kitty instance 2026-07-06 09:08:43 +05:30
copilot-swe-agent[bot]
21f7e96bef
Address code review: add comment, fallback timer, and warning log for PID monitoring 2026-06-28 03:16:33 +00:00
copilot-swe-agent[bot]
aee532c586
Fix issue 10198: edit-in-kitty exits with editor's exit code
- Python (kitty/launch.py): Track editor PID via monitor_pid to capture
  exit code when editor window closes. Send exit code as data in the DONE
  message instead of sending no data.
- Go (tools/cmd/edit_in_kitty/main.go): Parse exit code from DONE message
  data and use lp.Quit(exit_code) to exit with the editor's exit code.
- Go (tools/cmd/tool/confirm_and_run_shebang.go): Check exit code when
  running edit-in-kitty as a subprocess; abort execution on editor failure.
2026-06-28 03:10:58 +00:00
Kovid Goyal
3d8a2fbb4f
Use SIMD base64 everywhere 2026-04-21 11:56:55 +05:30
Kovid Goyal
4e04e34438
Refactor dnd cmd queueing API 2026-04-19 22:54:44 +05:30
Kovid Goyal
0ddbffdf79
Allow mocking remote clients 2026-04-19 20:42:43 +05:30
copilot-swe-agent[bot]
2e314ecba9
Rewrite mouse-demo drop to use OnDnDData API; fix QueueDnDData bugs
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/3359d812-5cb2-44a6-ae6e-ba1d708c490a

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-16 15:32:49 +00:00
Kovid Goyal
e9f3844f64
Implement auto reload of config 2026-04-16 14:41:29 +05:30
Kovid Goyal
80ad647336
Start work on config watcher kitten 2026-04-16 12:37:43 +05:30
Kovid Goyal
2c9541cf21
Allow preloading multiple background images to GPU for fast switching
Fixes #9836
2026-04-15 22:34:20 +05:30
Kovid Goyal
bcae760ea7
Skeleton for dnd kitten 2026-04-14 11:20:30 +05:30
Kovid Goyal
59cf34ca58
Get machine_id working on macOS as well 2026-04-12 12:31:42 +05:30
Kovid Goyal
ccbe5d7db3
... 2026-04-12 11:47:49 +05:30
copilot-swe-agent[bot]
d7fcf30250
Improve mouse-demo DnD: region-only drops, file sizes, remote file support
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/df38243b-dc36-470c-bb8f-e1e8162bb1ab

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-12 05:58:10 +00:00
Kovid Goyal
01055d36b0
Move roundtrip on exit flag into terminal options to have a consistent API 2026-04-10 15:37:20 +05:30
Kovid Goyal
3fe884a29a
DRYer 2026-04-10 15:32:27 +05:30
Kovid Goyal
5e158f90a7
Fix some responses from terminal sometimes leaking into shell on after kitten exit
Always do a roundtrip at kitten exit, except for special purpose
kittens. This slows down exit by one round trip time (capped at 2
seconds), however it ensures that we never get terminal response leak.

Fixes #9839
2026-04-10 15:14:38 +05:30
Jake Stewart
1a62cde212
Add option to generate 256 color palette from first 16 colors
Needs more work to test and possibly implement reporting and setting
of the nullable color table colors.

Fixes #9426
2026-03-27 20:01:14 +05:30
Kovid Goyal
59117ff5fd
... 2026-03-21 08:41:48 +05:30
Kovid Goyal
27ad4bc070
Fix some more misc bugs in the DnD code 2026-03-21 08:41:48 +05:30
Kovid Goyal
1704d27004
... 2026-03-21 08:41:47 +05:30
Kovid Goyal
eddaaed3e3
Modernize Go code 2026-03-21 08:41:47 +05:30
copilot-swe-agent[bot]
3d13cf1ca5
Fix three bugs in mouse demo kitten DnD drop handling
Fixes #9631
2026-03-21 08:41:47 +05:30
copilot-swe-agent[bot]
9ee058eaf9
Initial implementation of drop client in mouse_demo
Fixes #9623
2026-03-21 08:41:47 +05:30
Kovid Goyal
b66703ec85
Merge branch 'pane-title-bar' of https://github.com/mcrmck/kitty 2026-03-05 08:31:50 +05:30
mcrmck
cc32af250b Rename pane → window title bar per reviewer feedback
- Rename all options from pane_title_* to window_title_*
- Use foreground/background instead of fg/bg in color option names
- Change color options to to_color_or_none defaulting to None,
  falling back to corresponding tab bar colors
- Add bell_symbol, activity_symbol, progress_percent template vars
  using existing bell_on_tab and tab_activity_symbol options
- Add custom script support via window_title_bar.py in config dir
  (draw_window_title function exposed as {custom} in templates)
- Update C structs, Python references, and regenerate config files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-01 23:53:28 -05:00
Daniel M German
723363601f Fix CI error by changing order of imports 2026-02-22 21:24:00 -08:00
Daniel M German
33b5b0a339 Add command_palette command to display bound keys
Add a Go-based command_palette kitten that provides a searchable,
interactive overlay for browsing and triggering keyboard shortcuts
and actions.

- New Go kitten at kittens/command_palette/ with FZF fuzzy search,
  grouped/flat views, and remote control action triggering
- Python collect_keys_data() does data collection, passed via stdin
- Navigation: arrows, ctrl+j/k (vim), ctrl+n/p (emacs), page up/down
- Enter triggers the selected action via RC command
- Help text displayed in footer for selected binding
- Added Go tests (main_test.go) and Python tests (command_palette.py)
2026-02-22 20:46:47 -08:00