-
Notifications
You must be signed in to change notification settings - Fork 93
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
Delay Ark startup until debugger is attached #742
Conversation
Is it reasonable to add this sort of debugging functionality to the jupyter interface @jmcphers? It's not meant to be a stable part of the API, it just enables a debugging/development convenience while preserving abstraction. |
Kernels that do not support a delayed startup can still provide an |
71e4bbc
to
716ab1d
Compare
9bd7c69
to
f74a47b
Compare
598f8b6
to
4be47ad
Compare
Branched from #741
Addresses #740
This PR makes it possible to automatically delay the startup of Ark until the debugger is attached to the process:
This is controlled by a new
positron.jupyterAdapter.attachOnStartup
setting. Set it totrue
in your settings.json to enable attach on startup.Edit: There is now also
positron.jupyterAdapter.sleepOnStartup
which can be combined with the above. Useful to attach the debugger and give some time to hit the pause button to enter some commands before resuming startup.Attach on startup is supported via a new undocumented argument
--startup-notifier-file
passed to Ark. It takes the path to a notification file to which the frontend writes when the debugger has been attached. Ark blocks until a change to the file is detected. After that, startup continues as normal. Implemented in Add--delay-startup
argument to Ark ark#35.The actions of adding this argument and attaching the debugger need to be performed in the
start()
method of the Jupyter kernel. To support this, Jupyter kernels now optionally accept a newJupyterKernelExtra
object containing custom implementations for this sort of extra functionality. This extra object is created and passed in by the Ark registration routine.