This issue is driving me crazy. Simply put, if I start the interactive python with run-python, I can use C-c C-c which binds to comint-interrupt-subjob to interrupt current job (e.g., an infinite loop), and the process is still alive. However, I simply cannot use C-c C-c in an inferior python started from elpy mode python script (e.g., with C-return, or C-c C-z, etc. ). Basically I cannot find a way to interrupt the process without kill the buffer.
I compared an inferior buffer started with run-python and with say, C-return, only to find that they have the exactly same minor modes and major mode (using C-h m). I did realize that Elpy has a slightly different way to start the inferior python based on the documentation for elpy-shell-get-or-create-process, in which it states that
Summary
This issue is driving me crazy. Simply put, if I start the interactive python with
run-python
, I can useC-c C-c
which binds tocomint-interrupt-subjob
to interrupt current job (e.g., an infinite loop), and the process is still alive. However, I simply cannot use C-c C-c in an inferior python started from elpy mode python script (e.g., withC-return
, orC-c C-z
, etc. ). Basically I cannot find a way to interrupt the process without kill the buffer.I compared an inferior buffer started with
run-python
and with say,C-return
, only to find that they have the exactly same minor modes and major mode (usingC-h m
). I did realize that Elpy has a slightly different way to start the inferior python based on the documentation forelpy-shell-get-or-create-process
, in which it states thatYet, by comparing the code, I still cannot figure out why
C-c C-c
works in one way but not another. Someone help!!!Steps to reproduce
make sure your Elpy mode is enabled for the python buffer
Now, if you change Step 2 to 2: 2. M-x run-python, Then in step 3, C-c C-c will do the job to terminate the loop.
My configuration
OS
MacOS 12.2.1
Result of
(elpy-config)
Elpy configuration in my init.el
I don't think Elpy configuration matters, because I can reproduce the same problem with no Elpy setup.