So I'm in a file and can't get out, I'm on SSH so can't reset terminal. Can anyone help? There is no information online that I can find, 99% of the results are about Vim but I'm not using Vim.
I've tried CTRL+C
, CTRL+D
, :quit
, exit
, quit
, ESC
and many more,
I've also tried all options in the opposite case.
Best Answer
There's multiple ways which worked for me, here they are.
Option one was to press CTRL+X+C
, the X
first is important.
Although you said you had tried this, so on to option two. Do what I said above, but putting C
first, then you should have an input at the bottom, enter !
and it should exit the editor.
You're welcome.
Hold the Ctrl button. Press 'x' button, release it, then press 'c' button: Exit Emacs
Reading the answers and the comments, it is very strange, that Ctrl+x then Ctrl+c is not working. All key combinations in Emacs are bound to commands, also Ctrl+x Ctrl-c. It is bound to the command
save-buffers-kill-terminal
So what you can try is press Alt-x to execute a command. You should see M-x in the minibueffer at the bottom of emacs. then enter save-buffers-kill-terminal and voilá, you exited emacs. (Emacs will ask, if you have unsaved buffers or running processes, otherwise it will exit directly)Hope this helps.