diff --git a/kitty/main.py b/kitty/main.py index d1ee39ef0..0dc3a58e3 100644 --- a/kitty/main.py +++ b/kitty/main.py @@ -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