Struct glint::term_buffer::TermBuffer [−][src]
pub struct TermBuffer { /* fields omitted */ }
Expand description
Represents a range of lines in a terminal and the cursor position. This is suitable when you don’t want to use an “alternate screen”, but rather retain previous terminal output, such as shell prompts/responses.
New frames are rendered by replacing the lines. All operations work on a relative coordinate system where (0, 0) is the top-left corner of the lines TermBuffer controls.
Further, we never check the actual cursor position, but rather move the cursor relative to its current position. The meaning of (0, 0) is actually the cursor position when TermBuffer first renders.
Implementations
Positions the cursor where (0, 0) is the first character printed by this program
This causes us to skip past the currently displayed buffer area and forget about it, resulting in future renders to happen below it. If this is called, and then the TermBuffer is dropped, the default behavior of clearing the area will be a no-op.
Perform the necessary update to the terminal. This may choose a more optimized update than a full frame.
Renders a complete frame to the terminal