-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] PR: Add command line option to connect to an existing kernel at startup (IPython console) #23444
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Social-Mean for your work on this!
cli_options = self.get_command_line_options() | ||
connection_file = cli_options.connection_file | ||
if connection_file is not None: | ||
self.create_client_for_kernel(connection_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be self.create_client_for_kernel(connection_file, give_focus=False)
to give focus to the Editor and not the console at startup.
So, you need to improve that method to make it possible. For that:
-
Please add the
give_focus
kwarg to create_client_for_kernel. -
Pass it to the main widget method here:
spyder/spyder/plugins/ipythonconsole/plugin.py
Lines 749 to 751 in 210faf0
return self.get_widget().create_client_for_kernel( connection_file, hostname, sshkey, password, server_id, can_close ) -
Add
give_focus
as a kwarg to the widget method too:spyder/spyder/plugins/ipythonconsole/widgets/main_widget.py
Lines 1726 to 1727 in 210faf0
def create_client_for_kernel(self, connection_file, hostname, sshkey, password, server_id=None, can_close=True): -
Pass
give_focus
to theClientWidget
constructor:spyder/spyder/plugins/ipythonconsole/widgets/main_widget.py
Lines 1765 to 1774 in 210faf0
client = ClientWidget( self, id_=client_id, given_name=given_name, config_options=self.config_options(), additional_options=self.additional_options(), handlers=self.registered_spyder_kernel_handlers, server_id=server_id, can_close=can_close, )
Co-authored-by: Carlos Cordoba <[email protected]>
Description of Changes
Issue(s) Resolved
Fixes #23130
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: Social-Mean