Commit Graph

1986 Commits

Author SHA1 Message Date
Kovid Goyal
ef07942c82 More work on dnd kitten 2026-04-19 10:35:29 +05:30
Kovid Goyal
36171d1233 More work on dnd kitten 2026-04-19 10:21:01 +05:30
Kovid Goyal
c3d1665fa6 run go modernizer 2026-04-16 19:12:31 +05:30
Kovid Goyal
15a6a51a22 Fix RemoteCommand usage with bootstrap.py and bootstrap.sh not exiting after RemoteCommand 2026-04-15 05:37:56 +05:30
Kovid Goyal
a47093a7bf ssh kitten: Fix -o RemoteCommand handling 2026-04-15 05:19:22 +05:30
Kovid Goyal
8697da9e2a Merge branch 'feature/support-ssh-remote-command' of https://github.com/zzhaolei/kitty
Fixes #3988
2026-04-14 12:53:34 +05:30
zhaolei
b86367483f Asynchronously read ssh configuration 2026-04-14 14:29:18 +08:00
Kovid Goyal
bcae760ea7 Skeleton for dnd kitten 2026-04-14 11:20:30 +05:30
zhaolei
9b02a59c4e Add support for RemoteCommand option in kitten ssh 2026-04-14 11:11:51 +08:00
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
Kevin Lui
be7a010b9c hints: Fix trailing punctuation being included in detected URLs 2026-04-07 22:57:36 -07:00
Daniel M German
640225315a Fix ruff E731: replace lambda assignment with def 2026-04-06 09:54:56 -07:00
Daniel M German
3d89cb267c Add alias and combine support to the command palette
Users who define action_alias or kitten_alias in kitty.conf had no way
to discover or trigger these custom commands from the command palette.
Aliased keybindings were miscategorized (landing in "Miscellaneous"
with no help text), and combine bindings had the same problem.

Changes:

- Resolve aliases via opts.alias_map to get correct action names,
  categories, and help text for aliased keybindings
- Add dedicated "Action aliases" and "Kitten aliases" sections that
  list all user-defined aliases, with bound aliases showing their key
  and unbound aliases browsable as unmapped entries
- Add a "Combined actions" section for combine keybindings
- Make alias names searchable in the Go TUI so users can find
  bindings by typing the alias name
- Fix action column highlight positions to match the scored text,
  preventing visual corruption when searching for alias names

Also refactors collect_keys_data into focused single-responsibility
functions and reduces nesting depth across both Python and Go.
2026-04-06 09:45:39 -07:00
Павел Мешалкин
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
Jack Duvall
c48111d92c Highlight full extent of hint matches, not just the prefix label
Add --hints-text-background-color option (default: auto) that can apply
a background color to the matched text after the hint label. This makes
it more clear exactly which text each hint covers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 11:23:30 -04:00
Daniel M German
9619571dd3 Command palette: fix gofmt struct field alignment in tests 2026-03-22 17:59:42 -07:00
Daniel M German
6a3fe6ae01 Command palette: word-level search with multi-token cross-column matching
Implement a word-level scoring engine for the command palette that replaces
the previous FZF-based approach. Query tokens are matched against pre-tokenized
words in each column (key, action, category) with exact, prefix, and
edit-distance scoring. Multiple search terms are supported with cross-column
matching — items matching more tokens rank higher. Compound query tokens
containing delimiters (e.g. mouse_selection) are matched as units.

Add comprehensive tests using a Go builder API instead of raw JSON blobs,
covering single-token, multi-token, partial-match, ranking, mouse binding,
and unmapped action scenarios.

Add documentation for the command palette kitten.
2026-03-22 17:28:28 -07:00
Kovid Goyal
eddaaed3e3 Modernize Go code 2026-03-21 08:41:47 +05:30
copilot-swe-agent[bot]
3862ae26cc Fix fuzzy match highlighting in choose_files kitten
Fixes #9693
2026-03-17 14:28:56 +05:30
Kovid Goyal
01a70e06c4 ... 2026-03-12 13:53:41 +05:30
Kovid Goyal
0614f05335 Use new SIMD function for non blank checking 2026-03-12 13:50:35 +05:30
Kovid Goyal
d8af7e2c88 Add an option to control highlighting of moved lines 2026-03-12 12:59:46 +05:30
copilot-swe-agent[bot]
f45345c7a7 Add colorMoved support to kitty diff kitten
Fixes #3241
Fixes #9644
2026-03-12 12:44:21 +05:30
Kovid Goyal
9aa938c6cd Make the error message a bit more clear 2026-03-11 21:13:24 +05:30
Kovid Goyal
50bc3f465e Cleanup previous PR
Also fix ask kitten not setting window title in modes other than choose
2026-03-05 11:19:40 +05:30
Kovid Goyal
d15905c918 Change default word regexp to exclude punctuation 2026-03-04 09:20:53 +05:30
copilot-swe-agent[bot]
1785873835 diff kitten: Use a words based algorithm for intra line changed region highlighting
Fixes #9598
2026-03-04 09:06:37 +05:30
Kovid Goyal
ebbfb206e6 Run command palette action after event loop tick 2026-03-03 15:44:08 +05:30
Kovid Goyal
ab40d41609 Make gofmt happy 2026-03-03 15:37:55 +05:30
copilot-swe-agent[bot]
5638d20921 Make showing of unmapped actions a runtime cached setting
Fixes #9591
2026-03-03 15:24:26 +05:30
copilot-swe-agent[bot]
f13c8cd44d Allow optionally showing unmapped actions in the command palette
Also highlight letters matching the search query.
Fixes #9589
2026-03-03 14:29:10 +05:30
Kovid Goyal
4ec1fa5168 Prevent invocation of command-palette from command line 2026-03-03 13:13:20 +05:30
copilot-swe-agent[bot]
347c829156 Cleanup previous PR
Various fixes and improvements to the command palette kitten

Fixes #9585
2026-03-03 13:04:26 +05:30
Kovid Goyal
813f8ba7cf Merge branch 'show_keys' of https://github.com/dmgerman/kitty 2026-03-03 09:47:41 +05:30
Kovid Goyal
a1927eb662 DRYer 2026-02-25 09:11:04 +05:30
Kovid Goyal
b26d0b6ac5 Add more text file types to kitten diff completion
Fixes #9556
2026-02-25 08:57:54 +05:30
Daniel M German
6fa122af11 Fix action triggering by using kitten output instead of remote control
The RC approach sent actions targeting the overlay window itself rather
than the underlying window. Switch to the standard kitten output pattern:
the Go kitten outputs the selected action definition via
KittenOutputSerializer, and handle_result in Python calls boss.combine()
with the correct target window after the overlay closes.
2026-02-22 21:12:36 -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
Kovid Goyal
3db06a2915 More debug prints 2026-02-22 16:44:57 +05:30
newwares
828bd56fa5 ssh kitten: Push and pop keyboard encoding flags 2026-02-07 20:26:28 -05:00
Kovid Goyal
c0bb8ae2a0 desktop-ui kitten: Re-read config on every file chooser invocation via portal
Allows easily changing the config without needing to restart the kitten
which is difficult to do given its lifetime is managed by the xdg
portals service.
2026-02-03 21:08:55 +05:30
Kovid Goyal
a5433b8994 kitten choose-files: Add a new binding of Alt+Enter to modify the name of an existing file when choosing a save file name
Fixes #9387
2026-01-26 11:50:08 +05:30
Kovid Goyal
ada88e063b choose-files: Fix TAB completion in file prompt not respecting current cwd 2026-01-26 11:50:08 +05:30
Kovid Goyal
dadd2b88de DRYer 2026-01-24 14:57:48 +05:30
Kovid Goyal
9ac0f5b615 Forgot to increment expecting index 2026-01-24 14:55:25 +05:30
Kovid Goyal
85d813eeed num_items should be decreased even for pending 2026-01-24 14:47:08 +05:30
Kovid Goyal
ff33180f11 ... 2026-01-24 14:46:25 +05:30
Kovid Goyal
be0dd00606 icat kitten: When catting multiple images display the images in input order
Fixes #9413
2026-01-24 14:16:54 +05:30
Kovid Goyal
d1b9b5ac4f themes kitten: Also underline trigger keys on confirmation page. Apparently some people use color themes where SGR 31 does not contrast with the default foreground color. 2026-01-02 11:24:11 +05:30