From 0a9005f5cee852535b1ad31f3961144e1cca98d2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Nov 2021 10:21:39 +0530 Subject: [PATCH] Allow zsh-newuser-install to run Shell integration wont be turned on for an unconfigured zsh --- kitty/shell_integration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kitty/shell_integration.py b/kitty/shell_integration.py index 7a044f856..01a77f215 100644 --- a/kitty/shell_integration.py +++ b/kitty/shell_integration.py @@ -74,6 +74,12 @@ def setup_fish_env(env: Dict[str, str]) -> None: def setup_zsh_env(env: Dict[str, str]) -> None: zdotdir = os.environ.get('ZDOTDIR') base = zdotdir or os.path.expanduser('~') + for q in ('.zshenv', '.zprofile', '.zshrc', '.zlogin'): + if os.path.exists(os.path.join(base, q)): + break + else: + # a new zsh install dont prevent zsh-newuser-install from running + return if zdotdir is not None: env['KITTY_ORIG_ZDOTDIR'] = zdotdir env['KITTY_ZSH_BASE'] = base