Function linuxfb::set_terminal_mode

source ·
pub fn set_terminal_mode(
    tty: &impl AsRawFd,
    mode: TerminalMode
) -> Result<(), ErrnoError>
Expand description

Switch the terminal into desired mode.

There are two modes: “text” and “graphics”. In text mode, console output will be drawn to the terminal by the fbcon driver. In graphics mode it will not.

The given tty must refer to a real terminal (/dev/tty*).

When switching to graphics mode, make sure to switch back to text mode whenever the application exits. Otherwise the terminal will appear to be “stuck”, since no output will be shown.

Example:

let tty = std::fs::File::open("/dev/tty1").unwrap();
set_terminal_mode(&tty, TerminalMode::Graphics);