A terminal user interface (TUI) application built with Rust for dnet.
Install using cargo:
cargo install --git https://github.com/firstbatchxyz/dnet-tui.gitYou can install from source as well:
git clone https://github.com/firstbatchxyz/dnet-tui.git cd dnet-tui cargo build --release
Run the application:
dnet-tuiTo run from source:
cargo run
Run unit tests with:
cargo testWe also have window-specific tests under tests folder.
Tip
To print logs, you can run the program with
cargo run 2> debug.logOr, open another terminal and run the tty command, which returns something like /dev/pts/0. Then, forward to logs there:
cargo run 2> /dev/pts/0The code is structured so that all "windows" are thought of as their own modules, and they implement the required methods via impl App within their own file, with respect to visibility. Each window should also have a *View enum (for the sub-windows if required) and a *State struct that is an attribute of AppState.
Within each impl App we expect the following methods:
draw_*to handle drawing on screen (called viaterminal.draw)tick_*to handle ticks (effect within the running loop)handle_*to handle inputs from the user
See the LICENSE file for details.