Crate termal_core

Source
Expand description

Core library of termal, contains the implementation.

Modules§

codes
Module with ansi escape codes.
imageterm_image
This module allows generating images that can be displayed in teminal. Images may be displayed either with sixels (push_sixel) or texels (e.g. push_texel_quater).
procproc
Procedural macros implemented with proc_macro2.
rawraw
This module contains tools that make use of raw terminal.
term_textterm_text

Macros§

bg
Creates a true rgb background color. R, G and B must be values in range 0..256.
bg256
Creates a background color, color is value in range 0..256.
column
Moves cursor to the given column.
csi
Creates control escape sequence, the first literal is the end of the sequence, the other arguments are the values in the sequence.
delete_chars
Delete n characters, moving the chars from right.
delete_columns
Delete n columns, moving them from the right.
delete_lines
Delete n lines at the cursor, moving the remaining from bottom.
disable
Disables the given private terminal mode.
enable
Enables the given private terminal mode.
fg
Creates a true rgb foreground color. R, G and B must be values in range 0..256.
fg256
Creates a foreground color, color is value in range 0..256.
graphic
Creates control escape sequence for graphic mode.
insert_chars
Insert n characters, moving them to the right.
insert_columns
Insert n columns, moving them to the right.
insert_lines
Insert n lines at the cursor moving them down.
move_down
Moves cursor down by N positions.
move_left
Moves cursor left by N positions.
move_right
Moves cursor right by N positions.
move_to
Moves cursor to the given position. Position of the top left conrner is (1, 1).
move_up
Moves cursor up by N positions.
osc
Creates operating system command sequence. The arguments are the values in the sequence.
repeat_char
Repeat the previous char n times.
request_color_code
Requests the current color assigned to the given color code.
reset_color_code
Resets the color definition for the given color code.
scroll_region
set the scroll region in the terminal. also moves the cursor to the top left.
seq
Creates the given sequence, this is used internally.
set_down
Moves cursor to the start of line N lines down.
set_up
Moves cursor to the start of line N lines up
underline256
Set underline color as 256 color.
underline_rgb
Set underline color as rgb. R, G, and B muse be values in range 0..256.

Enums§

Error
Error type of termal. It is the only runtime error type used in termal.

Traits§

FromAnsiColorStr
Extension trait for Rgb to parse ansi color string.
ToAnsiColorStr
Extension trait for Rgb to convert it to ansi color string.

Functions§

gradient
Generates linear color gradient with the given text.
register_reset_on_panic
Registers panic hook that will prepend terminal reset before the current panic hook. Useful for tui apps.
reset_terminal
Resets terminal modes. This should in most cases restore terminal to state before your app started. Useful for example in case of panic.
rgb
Generate rgb value from hex.
write_gradient
Appends linear gradient to the given string.

Type Aliases§

Result
Result type for termal.
Rgb
Single RGB pixel.