Skip to main content

Module control

Module control 

Source
Expand description

Terminal control sequence generation — cursor movement, screen, titles, bells. Terminal control sequence generation — equivalent to Rich’s control.py.

Provides a unified Control type for composing terminal escape sequences: cursor movement, screen manipulation, window titles, and bells. Individual control codes can be combined and rendered as ANSI escape sequences.

§Quick Example

use rusty_rich::control::{Control, control_bell, control_home};

let bell = control_bell();
assert_eq!(bell.to_ansi(), "\x07");

let combined = Control::new(&["\x1b[H", "\x1b[2J"]);

Structs§

Control
A composable terminal control sequence.

Functions§

control_bell
Ring the terminal bell.
control_clear
Clear the entire screen.
control_home
Move cursor to home position.
control_move_to
Move cursor to an absolute position.
control_show_cursor
Show or hide the cursor.
control_title
Set terminal window title.
escape_control_codes
Escape control characters in a string, replacing them with visible representations like \\a, \\b, etc.
strip_control_codes
Strip control characters (bell, backspace, vertical tab, form feed) from a string.