-
Notifications
You must be signed in to change notification settings - Fork 166
C-c C-c doesn not interrupt the process in Emacs 29-3 while using ESS #1297
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
Comments
This is a different problem than I reported. I can cancel the Sys.sleep command with C-c C-c |
How do you proceed? You just put the cursor in iESS buffer and then you do C-c C-c ? Because when I do so, I just see C-c C-c being printed in iESS without any effect (= interruption) To be sure, I checked on several different machines, and each time there is the same problem. |
C-c C-c then Enter works for me. |
I'm experiencing a similar issue. C-c C-c followed by enter does not work for me. I use corfu for autocompletion and suspect this might be a duplicate of #1226 (see also #1267). I'm applying the temporary workaround suggested in those issue (disabling auto-completion by setting |
This is a quick follow up to confirm that, in my case, setting Note: A possibly better stopgap than disabling autocompletion with corfu would be to use cape wrappers as suggested by the author of corfu here. I don't have time to try this now, but will report again if I do. |
Hi! Another user here having the same issue. The author of corfu/cape suggested doing this:
Is there someone having a piece of config to work around the issue? This bug is a kind of annoying and I would like to see how others have handled it. Thanks for your help. Best. |
I've been using the following.:
|
Thank you so much @idhx. Maybe these lines should be upstream for now, until there is a definitive fix. Best. |
Glad this helped. Incidentally, coming back to this thread made me want to try the second option:
I wanted to try this because I was encountering very slow completion whenever I used a I've only just added the following lines to my config, but they seems to be working well so far. It's really nice to be able to get completions from ESS's company backends in corfu. The only annoyance is that corfu-popup-info mode does appear to play well with the company-R-objects backend, so I've disabled that for now. ;; required for ess company backends
(use-package company
:demand t)
;; Use ESS's company backends (with cape) to avoid hanging on print(). See
;; https://github.com/emacs-ess/ESS/issues/1247
(add-hook 'ess-mode-hook
(lambda ()
(progn
(setq-local completion-at-point-functions
(mapcar #'cape-company-to-capf
(list #'co
8000
mpany-R-args #'company-R-objects #'company-R-library)))
;; nice but breaks with completion of r objects
(corfu-popupinfo-mode -1)))) |
I get the same behavior ( Edit after a day: Many R sessions with |
I can reliably reproduce the behavior using the (Incidentally, This reproduces reliably on both macos (sequoia 15.2, R-4.3.3, ess-version: [elpa: 20241127.1620]) and linux (ubuntu 24.04, R-4.3.2, ess-version: [elpa: 20240821.1952]). I'm asking others to consider what is happening under the hood in that could contribute to the not-interruptibility. This does NOT hang (so it's not just while (TRUE) { Sys.sleep(1); message(format(Sys.time())); }
# 2025-02-11 09:18:17
# 2025-02-11 09:18:18
# 2025-02-11 09:18:19
# C-c C-c
httpgd::hgd()
# httpgd server running at:
# http://127.0.0.1:60946/live?token=6qZHAhGb
dev.list()
# unigd
# 2
while (TRUE) { Sys.sleep(1); message(format(Sys.time())); }
# 2025-02-11 09:18:23
# 2025-02-11 09:18:24
# C-c C-c
41+1
# [1] 42 Demoing with a very simple plumber interface, using a single endpoint: #* @get /test
function(req, res, ...) { Sys.sleep(1); pi; } Using that plumber::plumb("plumber.R")$run(port=9999)
# Running plumber API at http://127.0.0.1:9999
# Running swagger Docs at http://127.0.0.1:9999/__docs__/
# C-c C-c
41+1
# [1] 42 Same Sys.getpid()
# [1] 38659
httpgd::hgd()
# httpgd server running at:
# http://127.0.0.1:60978/live?token=f5a6qLEH
dev.list()
# unigd
# 2
plumber::plumb("plumber.R")$run(port=9999)
# Running plumber API at http://127.0.0.1:9999
# Running swagger Docs at http://127.0.0.1:9999/__docs__/
# C-c C-c
# C-c C-c
# C-c C-c
### `kill -HUP 38659`
# Process R:1 hangup: 1 at Tue Feb 11 09:21:24 2025 I don't have to actually call the As for signals to interrupt/kill the R process: I used Sys.getpid()
# [1] 39524
httpgd::hgd()
plumber::plumb("plumber.R")$run(port=9999)
# httpgd server running at:
# http://127.0.0.1:61644/live?token=r9gDWJsv
# Running plumber API at http://127.0.0.1:9999
# Running swagger Docs at http://127.0.0.1:9999/__docs__/
# C-c C-c
# C-c C-c
### `kill -PIPE 39524`
# Error in execCallbacks(timeoutSecs, all, loop$id) :
# ignoring SIGPIPE signal
41+2
# [1] 43
plumber::plumb("plumber.R")$run(port=9999)
# Running plumber API at http://127.0.0.1:9999
# Running swagger Docs at http://127.0.0.1:9999/__docs__/
# C-c C-c
# C-c C-c
### `kill -PIPE 39524` ...
# C-c C-c
# C-c C-c
### `kill -HUP 39524`
# Process R:1 hangup: 1 at Tue Feb 11 10:01:20 2025 My guess is that the I've not seen any of the ESS devs chime in yet on this. Is there anything you've seen in the interaction with |
I can confirm still an issue in
with |
I created this issue on July 2024 and I can confirm that the problem still persists:
It is impossible to interrupt any running R program via I saw also that disabling company-mode was suggested. But even doing that didn't solve the problem. |
I think the fact that it seems exacerbated by background (async, even) R operations is most likely the right direction to head towards. For instance, I am fairly confident many (all?) of the auto-completion modes (including Unfortunately, "async" is hard enough for many R programmers, and how it integrates with elisp is more still. I am interested in putting a bountysource on this (and some other ESS open bugs). I know the devs time is often taken for granted, and I don't want to maintain that vision. The fact that no devs have chimed in recently on this (or any?) issue is concerning: not that they're ignoring us, but perhaps they feel under-appreciated, over-worked, or something else. I think finding help to maintain ESS is a difficult chore, one I don't envy. There really are very few options for non-GUI R work that I and many others do, I would really like to see ESS continue to get maintenance and updates. What say you ESS devs (I'm not yet @-ing you by name), is a bountysource or similar a well-received step? I may be able to donate an under-used laptop, and if I can install macos on it perhaps that would be a helpful step for some mac-specific issues (not this one)? |
I just performed a test with |
@parvizfarnia what test did you perform? Using the combination of
All of the above tests are on the R console, no IDE (neither RStudio nor emacs/ess). I vote to close this issue, this is an upstream issue. |
Why voting to close the issue when it has not been solved? At least people who have encountered the same problem might be able to find more useful information here. You asked about the test that I performed. It was a small Shiny application. With 3 files in the same directory: app.R
server.R
ui.R
So what I did was to open I performed a second test, much simpler than the first one. All I had to do was to put the following code in a file and run it:
Again by simply doing a |
I think there are at least two possibilities:
I'm not trying to bully you into closing it. If you are confident that there is a combination that will still hang despite your code working on three OSes, then please add that info so that the devs have something to work on. My focus is to auto-reduce issues so that the devs have fewer issues to address. |
Maybe I didn't express myself correctly. I never said that it works on Windows: I just said that it worked on Linux Ubuntu That's why I said, there could be an OS specific problem (ESS or Emacs, I've not idea) |
Yes, and then in my comment:
I've tried your |
FYI, in case the dev(s) of |
Hello everyone,
My environment:
According to the online documentation:
https://ess.r-project.org/Manual/ess.html#Other
However, no matter how many times the user enters
C-C C-c
the current running job/process in R terminal within ESS is not interrupted. It is easy to reproduce:M-R
Sys.sleep(10)
Sys.sleep
viaC-c C-c
and you will see that it is not possible.Am I missing something with this new version of Emacs or is it a bug?
Thanks in advance.
The text was updated successfully, but these errors were encountered: