From c75b32f22bd23d86e3401d5fbd49bc40e0dcb076 Mon Sep 17 00:00:00 2001 From: ming <2052760@tongji.edu.cn> Date: Fri, 17 Jan 2025 19:47:44 +0800 Subject: [PATCH] Fix issue #23497 --- spyder/plugins/projects/plugin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spyder/plugins/projects/plugin.py b/spyder/plugins/projects/plugin.py index 7748d6adbe0..0d1af556ab3 100644 --- a/spyder/plugins/projects/plugin.py +++ b/spyder/plugins/projects/plugin.py @@ -290,7 +290,13 @@ 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') project = osp.normpath(