Commit Graph

1358 Commits

Author SHA1 Message Date
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
Kovid Goyal
950497ac0c Cleanup previous PR 2026-04-03 22:25:05 +05:30
z3rco
b39f88c6a2 Fix multiple security vulnerabilities across C, Python, and Go code
Timing-safe comparisons:
- crypto.c: Replace memcmp with CRYPTO_memcmp for Secret equality,
  require equal lengths before comparing
- remote_control.py: Constant-time password lookup to avoid leaking
  valid passwords via dict hash timing
- file_transmission.py: Use hmac.compare_digest for bypass token
  comparison instead of ==

Memory safety:
- child-monitor.c: Fix inverted condition in write_to_peer that
  prevented memmove from ever executing on partial writes
- ibus_glfw.c: Null-terminate IBUS_ADDRESS copy to prevent string
  overread when strlen >= PATH_MAX
- x11_window.c: Add NULL checks after realloc in clipboard/DnD
  data handling (two sites)
- dnd.c: Cap accepted_mimes at 1MB to prevent unbounded growth,
  fix realloc to not lose the original pointer on failure
- png-reader.c: Cast to size_t before multiplication to prevent
  integer overflow on 32-bit platforms

Secrets hygiene:
- disk-cache.c: Zero encryption_key with explicit_bzero before free

Tar extraction hardening:
- tar.go: Validate hardlink targets against destination prefix to
  prevent writing outside extraction directory
- tar.go: Strip setuid/setgid/sticky bits from extracted files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:10:46 +01:00
copilot-swe-agent[bot]
1853c48561 tui/password: make lock emoji blink at 500ms via repeating timer
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/3ee6840f-29cc-43bb-a4b6-bf9ae604ea11

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-01 02:51:40 +00:00
copilot-swe-agent[bot]
8aa83221e8 Improve password input: hide cursor and show lock emoji (U+1F512)
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/cf06c199-5837-41da-bebf-eb3c220684db

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-01 02:43:55 +00:00
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
copilot-swe-agent[bot]
6a0efbfdba Refactor ShortcutTracker.Match() to respect AllowFallback priority order
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/85fbf706-4688-4901-9a23-907cebc91da3
2026-03-26 04:31:37 +00:00
Kovid Goyal
88ee80b327 Cleanup previous PR
Actually respect the fallback order when finding matching shortcuts
2026-03-26 09:30:14 +05:30
Павел Мешалкин
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
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
7b9b8834a8 ... 2026-03-12 13:48:20 +05:30
copilot-swe-agent[bot]
f4bf9cf1c9 Add not_index_byte and not_index_byte2 functions to simdstring package
Fixes #9646
2026-03-12 13:47:05 +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
mcrmck
ab3a8ca56a Add pane title bar feature for window splits
Add an optional title bar that displays above or below each window pane
when multiple windows are visible in a tab. This is similar to tmux's
pane-border-format or Terminator's pane title bars.

New configuration options:
- pane_title_bar: none/top/bottom (default: none)
- pane_title_template: f-string template (same syntax as tab_title_template)
- active_pane_title_template: override for active pane
- pane_title_bar_active_fg/bg: colors for active pane title
- pane_title_bar_inactive_fg/bg: colors for inactive pane titles
- pane_title_bar_align: left/center/right text alignment

The title bars are rendered using virtual Screen objects registered with
the GPU, following the same model as the tab bar. Title bars are
automatically hidden when only a single window is visible.

Ref: https://github.com/kovidgoyal/kitty/discussions/9448

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-01 23:52:24 -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
newwares
828bd56fa5 ssh kitten: Push and pop keyboard encoding flags 2026-02-07 20:26:28 -05:00
ad-chaos
4897537481 better fix for kitty +lnum path 2026-01-26 15:50:54 +05:30
ad-chaos
17f2d2c574 Revert "Fix edit-in-kitty +lnum path"
This reverts commit 0f80229468.
2026-01-26 14:15:10 +05:30
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
phanium
0f80229468 Fix edit-in-kitty +lnum path 2026-01-01 18:28:07 +08:00
Kovid Goyal
e14e34948e More cleanups for color parsing
Using rounding when converting float to uint8 for more accuracy.
Fix rgb:3 and rgbi: parsing in Go code. Various other minor cleanups.
2025-12-31 09:35:09 +05:30
Kovid Goyal
a4d88beddb Micro-optimisation 2025-12-30 13:40:49 +05:30
Jökull Sólberg
64abd87a9e Add wide gamut color support with OKLCH and LAB formats
Implements modern wide gamut color formats with CSS Color Module Level 4
gamut mapping, addressing PR feedback with Go implementation, performance
benchmarks, and reorganized documentation.

Features:
- OKLCH (perceptually uniform color space)
- CIE LAB (device-independent color space)
- CSS Color 4 compliant gamut mapping algorithm
- Inline comment support in color config parsing

Addressing PR Feedback:

1. Go Implementation (tools/utils/style/):
   - Complete OKLCH and LAB parsing with gamut mapping
   - Matches Python implementation structure
   - Comprehensive test suite (all tests passing)
   - Performance benchmarks showing acceptable overhead

2. Performance Benchmarks:
   - OKLCH: ~4.6 µs/op
   - LAB: ~1.5 µs/op
   - 10 mixed colors: ~13 µs total
   - Typical config (50 colors): <0.5ms startup impact

3. Documentation Reorganization:
   - Moved detailed color docs to docs/wide-gamut-colors.rst
   - Configuration docs now link to separate documentation
   - Reduces size of main configuration documentation

Gamut Mapping:
- Binary search chroma reduction from CSS Color Module Level 4
- Preserves lightness and hue while reducing chroma for out-of-gamut colors
- Uses deltaE OK (JND threshold: 0.02) for perceptual difference
- Ensures graceful degradation on sRGB displays

Python Implementation:
- parse_oklch(): OKLCH color parsing with gamut mapping
- parse_lab(): CIE LAB parsing with gamut mapping via OKLCH conversion
- lab_to_oklch(): LAB to OKLCH conversion for consistent gamut mapping
- oklch_to_srgb_gamut_map(): CSS Color 4 gamut mapping algorithm
- srgb_to_oklab(): Reverse conversion for deltaE calculations
- deltaE_ok(): Perceptual color difference in OKLab space

Go Implementation:
- colorspaces.go: All color space conversions and gamut mapping
- wrapper.go: ParseColor() updated to support OKLCH and LAB
- Comprehensive test coverage with benchmarks
- Matches Python implementation behavior

Robustness:
- NaN and infinity validation in all color parsing functions
- Defense-in-depth with validation at parsing and gamut mapping levels
- Returns None/error for invalid input (consistent error handling)
- Validates before clamping operations to prevent NaN propagation

Files changed:
- Python: kitty/rgb.py, kitty_tests/datatypes.py (+250 lines)
- Go: tools/utils/style/colorspaces.go, wrapper.go (+350 lines, tests)
- Docs: docs/wide-gamut-colors.rst (moved from inline)
- Config: kitty/options/definition.py (simplified, links to docs)

References:
- CSS Color Module Level 4: https://www.w3.org/TR/css-color-4/
- OKLCH Color Space: https://bottosson.github.io/posts/oklab/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 14:34:34 +00:00
Kovid Goyal
f1cc676ea6 ... 2025-12-08 20:47:20 +05:30
Kovid Goyal
fee4cb0975 fix warning from linter 2025-12-02 23:37:53 +05:30
Kovid Goyal
f8db2702db choose files: Add a few more output formats 2025-11-26 21:13:57 +05:30
Kovid Goyal
fae50137a9 Add a clear cache action 2025-11-23 12:15:29 +05:30
Kovid Goyal
6de4e5237f Resize method should not use bounds 2025-11-17 12:59:04 +05:30
Kovid Goyal
68805850a5 Preserve opacity when resizing on image load 2025-11-15 14:56:21 +05:30
Kovid Goyal
25cf8622bc Avoid double is_opaque scan 2025-11-15 13:06:17 +05:30
Kovid Goyal
fb6332d8e2 Resize frames in parallel 2025-11-15 12:41:14 +05:30
Kovid Goyal
1d19942811 Store more metadata about pixel data shape when serializing 2025-11-15 12:23:56 +05:30
Kovid Goyal
9bc29a7fa6 Dont write to ~/.gitconfig in the tests
Just in case the tests are run without setting HOME
2025-11-13 18:50:42 +05:30
Kovid Goyal
9be602f94f ... 2025-11-11 21:39:12 +05:30
Kovid Goyal
6f588a0c29 run modernize 2025-11-11 17:09:37 +05:30
Kovid Goyal
d19fc375ba Switch to external shm package 2025-11-10 12:01:05 +05:30
Kovid Goyal
1c8e8e9530 Switch over to the new imaging backend for icat
Greatly simplifies a whole bunch of code. The new backend takes care of
falling back to ImageMagick efficiently itself.
2025-11-10 11:34:56 +05:30