0

In a regular terminal, I do

~ enter d

to disconnect from a ssh session.

sometimes I do ~ enter Ctl-z

to minimize/bg the ssh process

Is this possible while inside a M-x shell buffer in emacs.

(I use -nw terminal mode)

  • SSH session starts a shell on remote end to communicate with it. If you terminate that shell, the SSH session will also terminate. So, for example, if remote shell is anything compatible with sh, then typing exit will terminate the session. – wvxvw Jun 13 '18 at 11:52
  • sometimes I do ~ enter Ctl-z to minimize/bg the ssh process. So yeah I need a solution that's more general purpose – american-ninja-warrior Jun 13 '18 at 16:36
  • From gnu.org/software/emacs/manual/html_mono/eshell.html: Eshell has no job control, so you can not suspend or background the current process, or bring a background process into the foreground. – Arkadiusz Drabczyk Jun 13 '18 at 20:59
  • I am not referring to eshell, nor ansi-term. I am using M-x shell – american-ninja-warrior Jun 13 '18 at 23:55
1

In a regular terminal, I do

~ enter d

to disconnect from a ssh session.

It would be ~. for me, and that also works fine if I'd run ssh from a M-x shell buffer, with the exception that comint doesn't send the input to the process at all until RET is typed, so it needs to be:

~.RET

sometimes I do ~ enter Ctl-z

to minimize/bg the ssh process

~C-z here and this just needs a bit of quoted-insert to prevent Emacs from capturing the C-z, so the following works for me if I'd run ssh from a M-x shell buffer:

~C-qC-zRET

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.