6 releases

0.2.1 Sep 10, 2019
0.2.0 Sep 10, 2019
0.1.3 Sep 9, 2019

#755 in Command-line interface

Download history 20/week @ 2024-07-22 27/week @ 2024-07-29 54/week @ 2024-08-05 14/week @ 2024-08-12 36/week @ 2024-08-19 20/week @ 2024-08-26 10/week @ 2024-09-02 26/week @ 2024-09-09 1/week @ 2024-09-16 52/week @ 2024-09-23 64/week @ 2024-09-30 56/week @ 2024-10-07 102/week @ 2024-10-14 71/week @ 2024-10-21 59/week @ 2024-10-28 58/week @ 2024-11-04

291 downloads per month

MIT license

21KB
368 lines

vt-rs

Latest version Documentation License

Rust bindings for the Linux virtual terminal APIs.

Documentation: https://docs.rs/vt

Example

use std::io::Write;
use vt::Console;

// First of all, get a handle to the console
let console = Console::open().unwrap();

// Allocate a new virtual terminal
let mut vt = console.new_vt().unwrap();

// Write something to it.
// A `Vt` structure implements both `std::io::Read` and `std::io::Write`.
writeln!(vt, "Hello world!");

// Switch to the newly allocated terminal
vt.switch().unwrap();

License

vt-rs is released under the MIT license. For more information, see LICENSE.


lib.rs:

vt-rs

Rust bindings for the Linux virtual terminal APIs.

use vt::Console;

// First of all, get a handle to the console
let console = Console::open().unwrap();

// Allocate a new virtual terminal
let mut vt = console.new_vt().unwrap();

// Write something to it.
// A `Vt` structure implements both `std::io::Read` and `std::io::Write`.
writeln!(vt, "Hello world!");

// Switch to the newly allocated terminal
vt.switch().unwrap();

For a more complete example, see the files in the examples folder.

Dependencies

~1.5MB
~36K SLoC