diff --git a/kitty/boss.py b/kitty/boss.py index d4e1f5eba..633f50384 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -463,8 +463,11 @@ class Boss: set_boss(self) self.mappings: Mappings = Mappings(global_shortcuts, self.refresh_active_tab_bar) self.notification_manager: NotificationManager = NotificationManager(debug=self.args.debug_keyboard or self.args.debug_rendering) - if effective_config_path := store_effective_config(): + effective_config_path, effective_config_error = store_effective_config() + if effective_config_path: self.atexit.unlink(effective_config_path) + if effective_config_error: + self.misc_config_errors.append(effective_config_error) def startup_first_child(self, os_window_id: int | None, startup_sessions: Iterable[Session] = ()) -> None: si = startup_sessions or create_sessions(get_options(), self.args, default_session=get_options().startup_session) diff --git a/kitty/config.py b/kitty/config.py index 58ea0648a..ac5b3a9bd 100644 --- a/kitty/config.py +++ b/kitty/config.py @@ -202,7 +202,7 @@ def load_config(*paths: str, overrides: Iterable[str] | None = None, accumulate_ return opts -def store_effective_config() -> str: +def store_effective_config() -> tuple[str, str]: import os import stat import tempfile @@ -220,9 +220,10 @@ def store_effective_config() -> str: except OSError as err: # writing the effective config is a best effort debugging aid, do not # let it prevent kitty from starting, for example, when the disk is full - log_error(f'Failed to store effective config with error: {err}') - path = '' - return path + msg = f'Failed to store effective config with error: {err}' + log_error(msg) + return '', msg + return path, '' class KittyCommonOpts(TypedDict):