Crates.io | fltk-term |
lib.rs | fltk-term |
version | 0.1.4 |
source | src |
created_at | 2023-10-20 22:42:04.476059 |
updated_at | 2024-12-10 07:31:45.484929 |
description | A minimal terminal widget for fltk |
homepage | |
repository | https://github.com/fltk-rs/fltk-term |
max_upload_size | |
id | 1009496 |
size | 19,759 |
The fltk-term terminal is quite minimal, supports a limited subset of ansi escape sequences using vte, i.e. don't expect to run vim in it!, and is powered by portable-pty.
use fltk_term::PPTerm;
use fltk::{prelude::*, *};
fn main() {
let a = app::App::default();
let mut w = window::Window::default().with_size(600, 400);
let term = PPTerm::default().size_of_parent();
w.end();
w.show();
app::add_timeout3(0.2, move |_| {
term.write_all(r#"echo -e "\033[1;31mHELLO""#.as_bytes()).unwrap();
term.write_all(b"\n").unwrap();
});
a.run().unwrap();
}