Discussion:
recover hung emacs
(too old to reply)
HASM
2020-03-30 14:51:05 UTC
Permalink
scenario:
- ssh into remote machine
- start "emacs --daemon"
- connect with "emacsclient -nw"
- use normally
- eventually find-file to edit
(in may case it is a draft mh-e message)
- make sure it has some spelling mistakes
- start ispell on that buffer
(in my case triggered by mh-send-letter via hook)
- wait for ispell to suggest a correction in the minibuffer
- have the ssh connection drop
(this may not be needed!)
- start a new ssh
- connect with "emacsclient -nw"
- emacs opens in the *scratch* buffer
- there's a minibuffer message about exiting by deleting the frame
- emacs is totally unresponsive to keyboard

How do I recover, if I don't have access at the original ssh?
(e.g. it was starting from the "office" and I'm not on the "train")

Emacs seems to still respond to "emacsclient -e '(whatever)", but
(keyboard-quit) doesn't do it. Couple of times this happened I had to
kill emacs to restart, which could be a pain to recover from. Next time
maybe I'll try emacs-session-save, save-buffers-kill-emacs, restart
emacs and emacs-session-restore, but some of the shell/ssh session I may
have opened will be gone.

-- HASM
Javier
2020-04-01 21:57:18 UTC
Permalink
Post by HASM
- ssh into remote machine
...
- have the ssh connection drop
...
How do I recover, if I don't have access at the original ssh?
(e.g. it was starting from the "office" and I'm not on the "train")
Use gnu/screen or tmux to recover the terminal session.
Javier
2020-04-03 15:15:14 UTC
Permalink
Post by Javier
Post by HASM
How do I recover, if I don't have access at the original ssh?
(e.g. it was starting from the "office" and I'm not on the "train")
Use gnu/screen or tmux to recover the terminal session.
Being more specific:

to create new screen session

screen -S ${session_name}

to reattach lost screen session

screen -dR -S ${session_name}

Also, the default escape key C-a is too annoying. So use

echo 'escape ^vv' >> ~./screenrc

Continue reading on narkive:
Search results for 'recover hung emacs' (Questions and Answers)
10
replies
What is AIX Box?
started 2006-05-08 15:58:44 UTC
hardware
Loading...