diff --git a/spyder/plugins/projects/plugin.py b/spyder/plugins/projects/plugin.py index 7748d6adbe0..5e298c1f5b5 100644 --- a/spyder/plugins/projects/plugin.py +++ b/spyder/plugins/projects/plugin.py @@ -290,6 +290,12 @@ def on_mainwindow_visible(self): # Open project passed on the command line or reopen last one. cli_options = self.get_command_line_options() initial_cwd = self._main.get_initial_working_directory() + connection_file = cli_options.connection_file + + # Avoid conflicts with `--connect-to-kernel` option. See issue #23497 + # for more information. + if connection_file is not None: + return if cli_options.project is not None: logger.debug('Opening project from the command line')