From 5b2ba448b6b2b9b085d473d4145cb710f77f9531 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 23 Oct 2021 18:54:59 +0530 Subject: [PATCH] Only modify .zshrc to add shell integration if it already exists --- kitty/shell_integration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty/shell_integration.py b/kitty/shell_integration.py index 0a24ed253..4d40247ed 100644 --- a/kitty/shell_integration.py +++ b/kitty/shell_integration.py @@ -53,7 +53,8 @@ def setup_integration(shell_name: str, rc_path: str, template: str = posix_templ def setup_zsh_integration() -> None: base = os.environ.get('ZDOTDIR', os.path.expanduser('~')) rc = os.path.join(base, '.zshrc') - setup_integration('zsh', rc) + if os.path.exists(rc): + setup_integration('zsh', rc) def setup_bash_integration() -> None: