Fix the send_text action not working in URL handlers

send_text keeps its args as byte string, so variable expansion was not
working. Fixes #3081
This commit is contained in:
Kovid Goyal
2020-11-11 07:51:43 +05:30
parent 6bab967586
commit a40059729e
2 changed files with 9 additions and 1 deletions

View File

@@ -39,6 +39,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- 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]
-------------------

View File

@@ -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: