fix(search): give the in-place search a usable shortcut

kitty_mod+shift+f is the same physical key as kitty_mod+f, and
move_window_forward accepts the shifted fallback, so both definitions resolved
to the same trigger and the last one won: Ctrl+Shift+F moved the window instead
of opening the prompt, and the search had no shortcut at all. It now sits on
kitty_mod+alt+s, which no other default action claims.

Fixes #45
This commit is contained in:
BlackAngelTV committed 2026-12-03 10:21:00 +01:00
1 parent b036fb352e
commit 17462f5198
6 files changed
+25 -5

No files matched your search

+11
View File
@@ -29,6 +29,17 @@ class TestConfParsing(BaseTest):
def test_conf_parsing(self):
conf_parsing(self)
def test_default_search_shortcut(self):
from kitty.config import load_config
opts = load_config(overrides=())
keymap = opts.keyboard_modes[''].keymap
keys = [key for key, defns in keymap.items() if any(d.definition.split()[0] == 'search_scrollback_prompt' for d in defns)]
self.ae(len(keys), 1, 'the in-place search must have exactly one default shortcut')
# A shared trigger means the last definition wins silently and the search
# never opens, which is what happened with move_window_forward.
self.ae([d.definition.split()[0] for d in keymap[keys[0]]], ['search_scrollback_prompt'])
def test_launcher(self):
launcher(self)