macOS: Allow opening script and command

Fixes #3366
This commit is contained in:
Kovid Goyal
2021-03-10 21:33:29 +05:30
parent 0f020d5b37
commit f70c9842f5
12 changed files with 124 additions and 10 deletions

View File

@@ -914,6 +914,24 @@ def macos_info_plist() -> bytes:
def access(what: str, verb: str = 'would like to access') -> str:
return f'A program running inside kitty {verb} {what}'
docs = [
{
'CFBundleTypeName': 'Terminal scripts',
'CFBundleTypeExtensions': ['command', 'sh', 'zsh', 'bash', 'fish', 'tool'],
'CFBundleTypeIconFile': appname + '.icns',
'CFBundleTypeRole': 'Editor',
},
{
'CFBundleTypeName': 'Folders',
'CFBundleTypeOSTypes': ['fold'],
'CFBundleTypeRole': 'Editor',
},
{
'LSItemContentTypes': ['public.unix-executable'],
'CFBundleTypeRole': 'Shell',
},
]
pl = dict(
# see https://github.com/kovidgoyal/kitty/issues/1233
CFBundleDevelopmentRegion='English',
@@ -927,6 +945,7 @@ def macos_info_plist() -> bytes:
CFBundlePackageType='APPL',
CFBundleSignature='????',
CFBundleExecutable=appname,
CFBundleDocumentTypes=docs,
LSMinimumSystemVersion='10.12.0',
LSRequiresNativeExecution=True,
NSAppleScriptEnabled=False,