Previous: altsubbuffer, Up: Overview
Characters typed by the user are sent to the inferior.
How this is done depends on whether the term
buffer
is in "character" mode or "line" mode.
(A term
buffer can also be in "pager" mode.
This is discussed <later>.)
Which of these is currently active is specified in the mode line.
The difference between them is the key-bindings available.
In character mode, one character (by default C-c) is special, and is a prefix for various commands. All other characters are sent directly to the inferior process, with no interpretation by Emacs. Character mode looks and feels like a real terminal, or a conventional terminal emulator such as xterm.
In line mode, key commands mostly have standard Emacs actions. Regulars characters insert themselves into the buffer. When return is typed, the entire current line of the buffer (except possibly the prompt) is sent to the inferior process. Line mode is basically the original shell mode from earlier Emacs versions.
To switch from line mode to character mode type C-c C-k. To switch from character mode to line mode type C-c C-j.
In either mode, "echoing" of user input is handled by the inferior. Therefor, in line mode after an input line at the end of the buffer is sent to the inferior, it is deleted from the buffer. This is so that the inferior can echo the input, if it wishes (which it normally does).