diff --git a/docs/changelog.rst b/docs/changelog.rst index 4e3b364f8..ca6611b25 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -39,6 +39,8 @@ To update |kitty|, :doc:`follow the instructions `. - Dont ignore :option:`--title` when using a session file that defines no windows (:iss:`3055`) +- Fix the send_text action not working in URL handlers (:iss:`3081`) + 0.19.1 [2020-10-06] ------------------- diff --git a/kitty/open_actions.py b/kitty/open_actions.py index 0c6a0532f..408c99502 100644 --- a/kitty/open_actions.py +++ b/kitty/open_actions.py @@ -158,8 +158,14 @@ def actions_for_url_from_list(url: str, actions: Iterable[OpenAction]) -> Genera } def expand(x: Any) -> Any: + as_bytes = isinstance(x, bytes) + if as_bytes: + x = x.decode('utf-8') if isinstance(x, str): - return expandvars(x, env, fallback_to_os_env=False) + ans = expandvars(x, env, fallback_to_os_env=False) + if as_bytes: + return ans.encode('utf-8') + return ans return x for action in actions: