Next: , Previous: , Up: Overview  


1.1.2 The sub-buffer

A program that talks to terminal expects the terminal to have a fixed size. If the program is talking a terminal emulator program such as xterm, that size can be changed (if the xterm window is re-sized), but programs still assume a logical terminal that has a fixed size independent of the amount of output transmitted by the programs.

To programs that use it, the Emacs terminal emulator acts as if it too has a fixed size. The sub-buffer is the part of a term-mode buffer that corresponds to a "normal" terminal. Most of the time (unless you explicitly scroll the window displaying the buffer), the sub-buffer is the part of the buffer that is displayed in a window.

The sub-buffer is defined in terms of three buffer-local-variable:

Variable: term-height

The height of the sub-buffer, in screen lines.

Variable: term-width

The width of the sub-buffer, in screen columns.

Variable: term-home-marker

The "home" position, that is the top left corner of the sub-buffer.

The sub-buffer is assumed to be the end part of the buffer; the term-home-marker should never be more than term-height screen lines from the end of the buffer.