From ef9dada80df8493e67cdc0e6048f921b7ae498a5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Nov 2023 19:35:41 +0530 Subject: [PATCH] Failure to change to cwd should not be fatal in bootstrap.py to match bootstrap.sh --- shell-integration/ssh/bootstrap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell-integration/ssh/bootstrap.py b/shell-integration/ssh/bootstrap.py index 29343e44a..2d5e66a8e 100644 --- a/shell-integration/ssh/bootstrap.py +++ b/shell-integration/ssh/bootstrap.py @@ -295,7 +295,10 @@ def main(): cwd = os.environ.pop('KITTY_LOGIN_CWD', '') install_kitty_bootstrap() if cwd: - os.chdir(cwd) + try: + os.chdir(cwd) + except Exception as err: + print(f'Failed to change working directory to: {cwd} with error: {err}', file=sys.stderr) ksi = frozenset(filter(None, os.environ.get('KITTY_SHELL_INTEGRATION', '').split())) exec_cmd = b'EXEC_CMD' if exec_cmd: