Expand description
Core library of termal, contains the implementation.
Modules§
- codes
- Module with ansi escape codes.
- image
term_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
). - proc
proc
- Procedural macros implemented with
proc_macro2
. - raw
raw
- This module contains tools that make use of raw terminal.
- term_
text term_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§
- From
Ansi Color Str - Extension trait for
Rgb
to parse ansi color string. - ToAnsi
Color Str - 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.