Commit graph

177 commits

Author SHA1 Message Date
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
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
Kovid Goyal
3d8a2fbb4f
Use SIMD base64 everywhere 2026-04-21 11:56:55 +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
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
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
Kovid Goyal
10273d5aa2
kitten @: Fix relative paths for --password-file being resolved relative to CWD instead of the kitty config directory 2026-01-25 20:30:11 +05:30
Kovid Goyal
75ce50400e
Remote control: scroll-window: Allow fractional scrolling since we now have pixel scroll 2026-01-22 13:05:22 +05:30
Kovid Goyal
6f588a0c29
run modernize 2025-11-11 17:09:37 +05:30
Kovid Goyal
063cf243c1
add cursor_trail_color to nullable_colors and all_color_settings 2025-07-19 07:03:13 +05:30
Kovid Goyal
4a13c53438
Turn off focus tracking while doing tty remote control
Fixes #8733
2025-06-16 21:57:19 +05:30
Kovid Goyal
4713cc29ad
make gofmt happy 2025-05-16 09:40:34 +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
6a53897c17
change_font_size: allow multiplying/dividing the current font size in addition to incrementing it
Fixes #8616
2025-05-09 07:39:06 +05:30
Kovid Goyal
17876385c5
... 2025-04-23 18:52:40 +05:30
Kovid Goyal
f29bc638ce
Remote control: allow scrolling to prev/next prompt 2025-02-18 19:17:10 +05:30
Kovid Goyal
af83d855de
Add a framework for easily and securely using remote control from the main function of a custom kitten 2024-09-29 20:36:12 +05:30
Kovid Goyal
c1fb18a6ef
Implement changing transparent background colors via remote control 2024-09-24 19:02:13 +05:30
Kovid Goyal
dbfeb8d6a4
Store transparent colors on ColorProfile
This will eventually allow them to be changed using remote control and
escape codes.
2024-09-24 19:02:13 +05:30
Kovid Goyal
fdc3c3d7c1
kitten @: Fix a regression connecting to TCP sockets using plain IP addresses rather than hostnames
Fixes #7794
2024-08-27 18:30:51 +05:30
Kovid Goyal
2ac26b0e6d
Fix #7752 2024-08-20 17:27:13 +05:30
Kovid Goyal
0cf9a79760
A new option second_transparent_bg
Makes a second background color semi-transparent via background_opacity.
Useful for things like cursor line highlight in editors.

Fixes #7646
2024-07-21 20:22:31 +05:30
Kovid Goyal
608a497421
forgot to port test to use new API 2024-06-15 16:41:11 +05:30
Kovid Goyal
f4bec5f4ab
Remote control: Fix empty password not working
Fixes #7538
2024-06-15 11:15:19 +05:30
Kovid Goyal
b3ea6526e7
Forgot to change min bg opacity in the kitten code 2024-05-22 11:34:37 +05:30
Kovid Goyal
dbeb31b7ad
... 2024-05-18 08:44:09 +05:30
Kovid Goyal
c72ff568c5
Micro-optimization
Start the background process immediately and use a zero timer only if
executing the process fails, thereby guaranteeing ordering without
imposing a delay on process start.
2024-05-18 08:34:01 +05:30
Kovid Goyal
a9924d2ab7
oops 2024-05-17 22:45:52 +05:30
Kovid Goyal
9e3b49ab84
Micro-optimization 2024-05-17 22:36:09 +05:30
Kovid Goyal
a661f00651
Fix the previous fix
Store pending responses since the parser can call HandleDCS multiple
times in a single Read()
2024-05-17 22:27:17 +05:30
Kovid Goyal
703068f884
Fix packet coalescing over network transport causing remote control run over socket not working reliably 2024-05-17 22:18:04 +05:30
Kovid Goyal
64870af53f
simplify logic 2024-05-17 20:05:24 +05:30
Kovid Goyal
8a175010e6
typo 2024-05-14 20:32:34 +05:30
Kovid Goyal
38fed8b391
kitten @ run: A new remote control command to run a process on the machine kitty is running on and get its output
Fixes #7429
2024-05-14 14:32:01 +05:30
Kovid Goyal
1a394d6a57
Allow rc commands to control the exit code 2024-05-14 14:31:31 +05:30
Kovid Goyal
cbe4e705db
Allow at commands to specialize response handling 2024-05-14 13:14:21 +05:30
Kovid Goyal
8cb53cb5a6
Fix handling of streaming remote command via tty_io that doesnt actually stream anything 2024-05-14 13:13:17 +05:30
Kovid Goyal
814412b8ac
kitten @ send-key: Fix some keys being sent in kitty keyboard protocol encoding when not using socket for remote control
The @ kitten no longer changes keyboard mode unless actually needed.
2024-05-02 11:04:41 +05:30