0

I am using org-babel for literate programming and enjoying it so far. The major issue I have run into so far though is killing a runaway/hung remote shell command (short of exiting Emacs altogether).

A trivial example:

#+begin_src bash :session mysesh
ssh myserver
vim
#+end_src

#+begin_src bash :session mysesh
ls
#+end_src

Obviously the vim command causes it to hang (and lockup emacs). Using C-g will allow me to regain control of emacs, but the underlying session/ssh process is still locked up. This causes any subsequent commands that share that session (like ls in this example) to also lock up as the underlying session/ssh connection are still waiting on vim to finish.

Ideally I would like a way to send the equivalent of SIGINT/ctrl-c (from a terminal) to the session process so I could regain control of the session. Despite scouring the documentation however, I can't figure out how to do this. I am a little surprised, as I would have thought killing a hung session would be a pretty standard feature for something like babel.

1
  • There are lots of places where babel falls short: this may well be one of them. See if you can switch buffers to the session buffer mysesh and do the C-c there (or more likely :q to exit vim). – NickD Aug 8 '20 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.