From 6c139600a04fd19f0ac5cc93479864511594c960 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 7 Jan 2022 12:32:26 +0530 Subject: [PATCH] macOS: Also open .sh and .command files in the default shell --- kitty/boss.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kitty/boss.py b/kitty/boss.py index 26bc37a10..97d3795d7 100755 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -23,7 +23,7 @@ from .conf.utils import BadLine, KeyAction, to_cmdline from .config import common_opts_as_dict, prepare_config_file_for_editing from .constants import ( appname, config_dir, is_macos, is_wayland, kitty_exe, logo_png_file, - supports_primary_selection, website_url + shell_path, supports_primary_selection, website_url ) from .fast_data_types import ( CLOSE_BEING_CONFIRMED, GLFW_MOD_ALT, GLFW_MOD_CONTROL, GLFW_MOD_SHIFT, @@ -2217,7 +2217,9 @@ class Boss: else: from .guess_mime_type import guess_type mt = guess_type(path) or '' - if mt.startswith('text/'): + if os.path.splitext(path)[1].lower() in ('.sh', '.command'): + launch_cmd += [shell_path, path] + elif mt.startswith('text/'): launch_cmd += get_editor() + [path] elif mt.startswith('image/'): launch_cmd += [kitty_exe(), '+kitten', 'icat', '--hold', path]