Make cwd check more robust
Apparently getcwd() raises an exception on macOS when the cwd does not exist.
This commit is contained in:
parent
faac8649e4
commit
57f1bbb71a
@ -141,7 +141,11 @@ def _main():
|
||||
if is_macos and os.environ.pop('KITTY_LAUNCHED_BY_LAUNCH_SERVICES', None) == '1':
|
||||
os.chdir(os.path.expanduser('~'))
|
||||
args = macos_cmdline()
|
||||
if not os.path.isdir(os.getcwd()):
|
||||
try:
|
||||
cwd_ok = os.path.isdir(os.getcwd())
|
||||
except Exception:
|
||||
cwd_ok = False
|
||||
if not cwd_ok:
|
||||
os.chdir(os.path.expanduser('~'))
|
||||
args, rest = parse_args(args=args)
|
||||
args.args = rest
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user