#widgets #bindings #ui #graphics

fltk-term

A minimal terminal widget for fltk

5 releases

new 0.1.4 Dec 10, 2024
0.1.3 Dec 4, 2023
0.1.2 Dec 3, 2023
0.1.1 Dec 3, 2023
0.1.0 Oct 20, 2023

#1343 in GUI

Download history 8/week @ 2024-08-22 12/week @ 2024-08-29 7/week @ 2024-09-05 11/week @ 2024-09-12 22/week @ 2024-09-19 30/week @ 2024-09-26 23/week @ 2024-10-03 7/week @ 2024-10-10 113/week @ 2024-12-05

113 downloads per month

MIT license

9KB
168 lines

fltk-term

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.

Known issues

  • On Windows, the terminal defaults to cmd. More ansi escape sequences need to be handled to support powershell.

Usage

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();
}

Dependencies

~17MB
~372K SLoC