Merge branch 'fix-open-actions-shell' of https://github.com/page-down/kitty

This commit is contained in:
Kovid Goyal 2023-01-23 14:03:54 +05:30
commit 35c1ebd3f9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 4 deletions

View File

@ -68,6 +68,13 @@ some special variables, documented below:
The path, query and fragment portions of the URL, without any
unquoting.
``EDITOR``
The terminal based text editor. The configured :opt:`editor` in
:file:`kitty.conf` is preferred.
``SHELL``
The path to the shell. The configured :opt:`shell` in :file:`kitty.conf` is
preferred, without arguments.
.. note::
You can use the :opt:`action_alias` option just as in :file:`kitty.conf` to

View File

@ -74,7 +74,7 @@ def parse(lines: Iterable[str]) -> Iterator[OpenAction]:
with to_cmdline_implementation.filter_env_vars(
'URL', 'FILE_PATH', 'FILE', 'FRAGMENT', 'URL_PATH',
EDITOR=shlex.join(get_editor()),
SHELL=shlex.join(resolved_shell(get_options()))
SHELL=resolved_shell(get_options())[0]
):
for (mc, action_defns) in entries:
actions: List[KeyAction] = []
@ -234,12 +234,11 @@ action show_kitty_doc $URL_PATH
@run_once
def default_launch_actions() -> Tuple[OpenAction, ...]:
SHELL = resolved_shell(get_options())
return tuple(parse(f'''\
return tuple(parse('''\
# Open script files
protocol file
ext sh,command,tool
action launch --hold --type=os-window kitty +shebang $FILE_PATH {SHELL}
action launch --hold --type=os-window kitty +shebang $FILE_PATH $SHELL
# Open shell specific script files
protocol file