kitty/tools
Павел Мешалкин 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
..
cli Modernize Go code 2026-03-21 08:41:47 +05:30
cmd ... 2026-03-21 08:41:48 +05:30
config feat: add per-mapping --allow-fallback for layout-independent shortcuts 2026-03-25 19:34:13 +03:00
crypto Rename go module from kitty -> github.com/kovidgoyal/kitty 2025-05-16 08:43:39 +05:30
disk_cache Add a clear cache action 2025-11-23 12:15:29 +05:30
fzf Move error handling code into its own library 2025-10-12 13:51:16 +05:30
highlight Move error handling code into its own library 2025-10-12 13:51:16 +05:30
icons Fix recursion into symlinks to dirs 2025-06-25 08:35:38 +05:30
ignorefiles Dont write to ~/.gitconfig in the tests 2025-11-13 18:50:42 +05:30
rsync Modernize Go code 2026-03-21 08:41:47 +05:30
simdstring ... 2026-03-12 13:48:20 +05:30
themes Rename pane → window title bar per reviewer feedback 2026-03-01 23:53:28 -05:00
tty Modernize Go code 2026-03-21 08:41:47 +05:30
tui feat: add per-mapping --allow-fallback for layout-independent shortcuts 2026-03-25 19:34:13 +03:00
unicode_names Add support for Unicode 17 2025-10-18 09:59:53 +05:30
utils Modernize Go code 2026-03-21 08:41:47 +05:30
vt run modernize 2025-11-11 17:09:37 +05:30
wcswidth Modernize Go code 2026-03-21 08:41:47 +05:30
README.rst Update folder README 2023-03-27 13:20:10 +05:30

This folder contains library and utility code for the various "kittens". Small
terminal programs compiled statically for doing things like kitty remote
control, icat etc. These are often re-implementations of earlier kittens that
were written in Python.