macOS: Ensure that when running from a bundle, the bundle kitty exe is preferred over any kitty in PATH

Fix #1280
This commit is contained in:
Kovid Goyal 2019-01-14 09:32:49 +05:30
parent 30b5e8bf8f
commit c247a6c0cc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,8 @@ Changelog
- macOS: Fix dragging kitty window tabs in traditional full screen mode causing
crashes (:iss:`1296`)
- macOS: Ensure that when running from a bundle, the bundle kitty exe is
preferred over any kitty in PATH (:iss:`1280`)
0.13.2 [2019-01-04]
------------------------------

View File

@ -231,7 +231,7 @@ def _main():
rpath = os.path.dirname(kitty_exe())
items = frozenset(os.environ['PATH'].split(os.pathsep))
if rpath and rpath not in items:
os.environ['PATH'] += os.pathsep + rpath
os.environ['PATH'] = rpath + os.pathsep + os.environ.get('PATH', '')
args = sys.argv[1:]
if is_macos and os.environ.pop('KITTY_LAUNCHED_BY_LAUNCH_SERVICES', None) == '1':