diff --git a/RACCOURCIS-CLAVIER.md b/RACCOURCIS-CLAVIER.md index e1ff126..c16d5e7 100644 --- a/RACCOURCIS-CLAVIER.md +++ b/RACCOURCIS-CLAVIER.md @@ -81,7 +81,8 @@ Deux fonctions FWS ne demandent aucune touche : | `Ctrl+Shift+X` | Va au prompt suivant. | | `Ctrl+Shift+H` | Affiche tout l'historique dans un pager. | | `Ctrl+Shift+G` | Affiche la sortie de la dernière commande dans un pager. | -| `Ctrl+Shift+/` | Recherche dans l'historique. | +| `Ctrl+Shift+/` | Recherche dans l'historique dans un pager. | +| `Ctrl+Shift+Alt+S` | Recherche avec surlignage sur place (`n`/`N` pour naviguer, `Échap` pour quitter). | ## Fenêtres diff --git a/docs/basic.rst b/docs/basic.rst index e5c78d2..68ddddb 100644 --- a/docs/basic.rst +++ b/docs/basic.rst @@ -30,7 +30,9 @@ Search scrollback in place :sc:`search_scrollback_prompt` ========================== ======================= The in-place search highlights every match without replacing the screen with a -pager. Prefix the query with ``\c`` to match case sensitively and with ``\r`` +pager. It is bound to :kbd:`kitty_mod+alt+s` (:kbd:`Ctrl+Shift+Alt+S` by +default) and can also be run with :code:`kitten @ action +search_scrollback_prompt`. Prefix the query with ``\c`` to match case sensitively and with ``\r`` to use a regular expression; both modifiers can be combined. Write a doubled backslash (``\\c``, ``\\r``) to search for those prefixes literally. While the search is active, :kbd:`n` jumps to the next match, :kbd:`N` to the previous one and diff --git a/docs/changelog.rst b/docs/changelog.rst index be989d1..57e0696 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -263,6 +263,11 @@ Detailed list of changes :kbd:`kitty_mod+H` is pressed. The panel can also be started with :code:`kitty +kitten help`. +- The in-place scrollback search got a usable default shortcut: it was bound + to :kbd:`kitty_mod+shift+f`, the same physical key as :ac:`move_window_forward` + (which allows the shifted fallback), so the last definition won and the search + never opened. It is now on :kbd:`kitty_mod+alt+s`. + - The keyboard shortcuts panel ellipsizes a long action name inside its own column instead of letting the edge of the dock cut it, shrinks its key column on very narrow docks so that a row always fits, and shows the full name of diff --git a/kitty/options/definition.py b/kitty/options/definition.py index a38dbf2..524a6b1 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -4159,13 +4159,14 @@ map('Search the scrollback within a pager', 'search_scrollback --allow-fallback= map( 'Search and highlight the scrollback in place', - 'search_scrollback_prompt kitty_mod+shift+f search_scrollback_prompt', + 'search_scrollback_prompt kitty_mod+alt+s search_scrollback_prompt', long_text=""" Search the scrollback without opening a pager. Every match is highlighted in the scrollback and the ``[current/total]`` counter is shown in the window title. Prefix the query with ``\\c`` to match case sensitively and with ``\\r`` to use a regular expression. While a search is active, :kbd:`n` and :kbd:`N` jump to -the next and previous match and :kbd:`Escape` ends the search. +the next and previous match and :kbd:`Escape` ends the search. The default +binding is :kbd:`kitty_mod+alt+s` (:kbd:`Ctrl+Shift+Alt+S` by default). The :ac:`scrollback_search_next`, :ac:`scrollback_search_prev` and :ac:`clear_scrollback_search` actions can be mapped to other keys. diff --git a/kitty/options/types.py b/kitty/options/types.py index fa34ce6..a5d9623 100644 --- a/kitty/options/types.py +++ b/kitty/options/types.py @@ -937,7 +937,7 @@ defaults.map = [ # search_scrollback KeyDefinition(trigger=SingleKey(mods=256, key=47), definition='search_scrollback'), # search_scrollback_prompt - KeyDefinition(trigger=SingleKey(mods=257, key=102), definition='search_scrollback_prompt'), + KeyDefinition(trigger=SingleKey(mods=258, key=115), definition='search_scrollback_prompt'), # new_window KeyDefinition(trigger=SingleKey(mods=256, key=57345), definition='new_window'), # new_os_window diff --git a/kitty_tests/options.py b/kitty_tests/options.py index 29cb79e..354b7e2 100644 --- a/kitty_tests/options.py +++ b/kitty_tests/options.py @@ -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)