Upon starting term-mode, Emacs delegates all keypresses to the terminal you're running.

That's great for compatibility purposes, but leaves Emacs functionality behind. How do I get back to Emacs features (for example, to switch a buffer).


In term-mode, there are two input modes. In the default input mode -- char-mode -- all keypresses (except C-c) are sent to the terminal to do what it wishes with.

If you change the input mode to line-mode, then regular Emacs commands work. You can switch to line-mode with C-c C-j. You can switch back to char-mode with C-c C-k.

  • 5
    Note that there is also term-escape-char (defaults to C-c). This keypress is not sent to the terminal directly even in char-mode, but is translated to C-x. With its help you can switch from a char-mode term buffer to a different window using C-c o (translated to C-x o), to a different buffer with C-c b (C-x b), get a list of buffers with C-c C-b (C-x C-b), etc. Dec 23 '14 at 20:56
  • 1
    How can I make line-mode the default ?
    – haknick
    Oct 10 '15 at 4:28
  • 1
    @haknick I'm not sure offhand -- you should ask a separate question about that, and see if anyone knows.
    – zck
    Oct 10 '15 at 6:07

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.