diff --git a/kitty/shell_integration.py b/kitty/shell_integration.py index 0e50df9ca..5ac608d04 100644 --- a/kitty/shell_integration.py +++ b/kitty/shell_integration.py @@ -119,14 +119,14 @@ def setup_shell_integration(opts: Options, env: Dict[str, str]) -> bool: def modify_shell_environ(argv0: str, opts: Options, env: Dict[str, str]) -> None: + shell = get_supported_shell_name(argv0) + if shell is None: + return if 'disabled' in set(opts.shell_integration.split()): return env['KITTY_SHELL_INTEGRATION'] = opts.shell_integration if not shell_integration_allows_rc_modification(opts): return - shell = get_supported_shell_name(argv0) - if shell is None: - return f = ENV_MODIFIERS.get(shell) if f is not None: try: