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).
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>
Two fixes:
1. boss.py: scope window drag is_dest to the receiving OS window only.
Previously all tab managers got is_dest=True with the same window-local
coordinates. Since every OS window's viewport starts at (0,0), a drag at
(x,y) in Window 1 also matched windows in Window 2 at the same coords,
causing spurious highlights and incorrect drop-target state in the second
window.
2. tabs.py: filter synthetic tab IDs (< 0) from all_tabs in on_tab_drop_move.
The '+' new-tab indicator uses tab_id=-1. If a tab drag started while
window_drag_active or tab_bar_show_new_tab_button was set, the -1 ended
up in tab_being_dropped.tab_ids, then tab_bar_data crashed with KeyError
when it tried tmap[-1].
According to
https://nixos.org/manual/nixpkgs/stable/#sec-darwin-legacy-frameworks,
the darwin.apple_sdk.framework namespace has been deprecated.
This commit updates shell.nix to be compatible with the nixos-unstable
channel on darwin. Tested by running `nix-shell --pure` and then `make`
inside that shell.
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.
Default is 'no' to avoid forcing the button on all kitty users. When disabled,
the '+' indicator still appears during window drags as a drop target (existing
behaviour). Set to 'yes' to keep it permanently visible as a clickable button.
- Skip user tab_title_template for synthetic tabs (tab_id < 0) so custom
templates referencing layout_name no longer produce '? +' during drags
- Always append the '+' drop indicator to tab_bar_data (not only during
window drags), making it a persistent clickable new-tab button
- Handle click on the '+' tab (tab_id == -1) in the tab bar mouse handler
by calling new_tab() on left-button release
When a USB HID device (keyboard/mouse) is disconnected, X11 fires an
XI_HierarchyChanged event, which triggers read_xi_scroll_devices().
That function calls XIGetProperty() on devices from XIQueryDevice().
There is a race condition: if a device is removed between these calls,
X11 generates an XI_BadDevice error. Without a custom error handler, the
default X11 handler calls exit(), killing kitty.
Fix: wrap the device query loop in read_xi_scroll_devices() with
_glfwGrabErrorHandlerX11() / _glfwReleaseErrorHandlerX11() so that any
XI_BadDevice error is captured by kitty's own handler rather than the
default fatal one.
Fixes#9723Fixes#9724