From ddb9b67de3411e273e70027cab42487f34b23559 Mon Sep 17 00:00:00 2001 From: pagedown Date: Sat, 5 Feb 2022 13:23:41 +0800 Subject: [PATCH] Restrict custom launch actions to be prefixed with `kitty:///launch/` Preserve the kitty URL scheme for further use. --- kitty/open_actions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kitty/open_actions.py b/kitty/open_actions.py index 58d6c0308..5495d9a30 100644 --- a/kitty/open_actions.py +++ b/kitty/open_actions.py @@ -259,6 +259,9 @@ def actions_for_url(url: str, actions_spec: Optional[str] = None) -> Iterator[Ke def actions_for_launch(url: str) -> Iterator[KeyAction]: + # Custom launch actions using kitty URL scheme needs to be prefixed with `kitty:///launch/` + if url.startswith('kitty://') and not url.startswith('kitty:///launch/'): + return found = False for action in actions_for_url_from_list(url, load_launch_actions()): found = True