pub enum Change {
Show 15 variants
Attribute(AttributeChange),
AllAttributes(CellAttributes),
Text(String),
ClearScreen(ColorAttribute),
ClearToEndOfLine(ColorAttribute),
ClearToEndOfScreen(ColorAttribute),
CursorPosition {
x: Position,
y: Position,
},
CursorColor(ColorAttribute),
CursorShape(CursorShape),
CursorVisibility(CursorVisibility),
Image(Image),
ScrollRegionUp {
first_row: usize,
region_size: usize,
scroll_count: usize,
},
ScrollRegionDown {
first_row: usize,
region_size: usize,
scroll_count: usize,
},
Title(String),
LineAttribute(LineAttribute),
}Expand description
Change describes an update operation to be applied to a Surface.
Changes to the active attributes (color, style), moving the cursor
and outputting text are examples of some of the values.
Variants§
Attribute(AttributeChange)
Change a single attribute
AllAttributes(CellAttributes)
Change all possible attributes to the given set of values
Text(String)
Add printable text. Control characters are rendered inert by transforming them to space. CR and LF characters are interpreted by moving the cursor position. CR moves the cursor to the start of the line and LF moves the cursor down to the next line. You typically want to use both together when sending in a line break.
ClearScreen(ColorAttribute)
Clear the screen to the specified color. Implicitly clears all attributes prior to clearing the screen. Moves the cursor to the home position (top left).
ClearToEndOfLine(ColorAttribute)
Clear from the current cursor X position to the rightmost edge of the screen. The background color is set to the provided color. The cursor position remains unchanged.
ClearToEndOfScreen(ColorAttribute)
Clear from the current cursor X position to the rightmost edge of the screen on the current line. Clear all of the lines below the current cursor Y position. The background color is set ot the provided color. The cursor position remains unchanged.
CursorPosition
Move the cursor to the specified Position.
CursorColor(ColorAttribute)
Change the cursor color.
CursorShape(CursorShape)
Change the cursor shape
CursorVisibility(CursorVisibility)
Change the cursor visibility
Image(Image)
Place an image at the current cursor position.
The image defines the dimensions in cells.
TODO: check iterm rendering behavior when the image is larger than the width of the screen.
If the image is taller than the remaining space at the bottom
of the screen, the screen will scroll up.
The cursor Y position is unchanged by rendering the Image.
The cursor X position will be incremented by Image::width cells.
ScrollRegionUp
Scroll the region_size lines starting at first_row upwards
by scroll_count lines. The scroll_count lines at the top of
the region are overwritten. The scroll_count lines at the
bottom of the region will become blank.
After a region is scrolled, the cursor position is undefined,
and the terminal’s scroll region is set to the range specified.
To restore scrolling behaviour to the full terminal window, an
additional Change::ScrollRegionUp { first_row: 0, region_size: height, scroll_count: 0 }, where height is the height of the
terminal, should be emitted.
ScrollRegionDown
Scroll the region_size lines starting at first_row downwards
by scroll_count lines. The scroll_count lines at the bottom
the region are overwritten. The scroll_count lines at the top
of the region will become blank.
After a region is scrolled, the cursor position is undefined,
and the terminal’s scroll region is set to the range specified.
To restore scrolling behaviour to the full terminal window, an
additional Change::ScrollRegionDown { first_row: 0, region_size: height, scroll_count: 0 }, where height is the
height of the terminal, should be emitted.
Title(String)
Change the title of the window in which the surface will be rendered.
LineAttribute(LineAttribute)
Adjust the current line attributes, such as double height or width