6 releases

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

#686 in Command-line interface

47 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