dap-mode
dap-mode copied to clipboard
Display graphics and pretty printed formulae with `dap-ui-repl`.
Currently, I'm using the comint-mime package with the following configuration:
(use-package comint-mime
:straight (:host github :repo "astoff/comint-mime"
:files (:defaults "*.py" "*.sh"))
:hook ((shell-mode inferior-python-mode) . comint-mime-setup))
With the help of the above package, Emacs can display graphics and pretty printed formulae as follows, just as I've discussed here:
But I want to know if we can get the similar feature in dap-ui-repl
.
Regards, HZ
ATM this is not possible using dap-ui-repl. Somebody has to investigate and implement it if possible.
Is there a way to, at least, use ipython shell in dap-ui-repl ?
@amirdib in general, you may run an external python process that supports graphics and connect using dap-mode.
@yyoncho Does the comint-mime based example I showed above fall into the situation you said?
@amirdib in general, you may run an external python process that supports graphics and connect using dap-mode.
Can you point to the relevant documentation entry ? I can't find what you're referring to. If so, that would solve the issue.
reffer to that, and afaics there is attach template registered in dap-python: https://github.com/microsoft/debugpy#attaching-to-a-running-process-by-id
Thank you for your linked documentation. But if I start a process, say ipython
, the PID
should be generated/assigned randomly completely. So, I still can't figure out how to use the example given there.
reffer to that, and afaics there is attach template registered in dap-python: https://github.com/microsoft/debugpy#attaching-to-a-running-process-by-id
Thanks. Indeed, there is an attach option: https://code.visualstudio.com/docs/python/debugging
I think PID is not needed. Next step will be to try on a minimal example @hongyi-zhao
@amirdib If you have figured out one, hope you can follow up and post here.
Thank you for your linked documentation. But if I start a process, say
ipython
, thePID
should be generated/assigned randomly completely. So, I still can't figure out how to use the example given there.
You can find the PID of a process by name with pgrep. So, python3 -m debugpy --listen localhost:5882 --pid $(pgrep -f main.py)
will inject in debugger in main.py
Still not so clear. Run this from within Emacs? Could you please describe the specific steps?
Still not so clear. Run this from within Emacs? Could you please describe the specific steps?
I don't think that the solution proposed by @yyoncho correspond to what we intend to do. We want our debug shell to be a comint buffer that can display graphics. For that, would likely require to investigate and rewrite the dap-ui-repl
function imo