14

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).

zck
  • 8,984
  • 2
  • 31
  • 65

1 Answers1

16

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.

zck
  • 8,984
  • 2
  • 31
  • 65
  • 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. – Constantine Dec 23 '14 at 20:56
  • 1
    How can I make line-mode the default ? – haknick Oct 10 '15 at 04: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 06:07