• recover hung emacs

    From HASM@21:1/5 to All on Mon Mar 30 07:51:05 2020
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Javier@21:1/5 to HASM on Wed Apr 1 16:57:18 2020
    HASM <hasm@example.invalid> wrote:

    scenario:
    - 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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Javier@21:1/5 to All on Fri Apr 3 10:15:14 2020
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)