Next: , Up: Overview  


1.1.1 Output from the inferior

In typical usage, output from the inferior is added to the end of the buffer. If needed, the window will be scrolled, just like a regular terminal. (Only one line at a time will be scrolled, just like regular terminals, and in contrast to the old shell mode.) Thus the buffer becomes a log of your interaction with the inferior, just like the old shell mode.

Like a real terminal, term maintains a "cursor position." This is the process-mark of the inferior process. If the process-mark is not at the end of the buffer, output from the inferior will overwrite existing text in the buffer. This is like a real terminal, but unlike the old shell mode (which inserts the output, instead of overwriting).

Some programs (such as Emacs itself) need to control the appearance on the screen in detail. They do this by sending special control codes. The exact control codes needed from terminal to terminal, but nowadays most terminals and terminal emulators (including xterm) understand the so-called "ANSI escape sequences" (first popularized by the Digital’s VT100 family of terminal). The term mode also understands these escape sequences, and for each control code does the appropriate thing to change the buffer so that the appearance of the window will match what it would be on a real terminal. (In contrast, the old shell mode doesn’t handle terminal control codes at all.)

See <...> for the specific control codes.