Something went wrong. Try again.
Easy terminal event handling and rendering with Bevy!
Something went wrong. Try again.
Files
0.20.0
Verified signature Signed by sntx.space SHA256:9LQu26fVcsGOo5rOQa/2DHNL9feUaE7+Iii91ekhLX4 Click to copy SHA
Verified signature Signed by sntx.space SHA256:9LQu26fVcsGOo5rOQa/2DHNL9feUaE7+Iii91ekhLX4 Click to copy SHA
Verified signature Signed by sntx.space SHA256:9LQu26fVcsGOo5rOQa/2DHNL9feUaE7+Iii91ekhLX4 Click to copy SHA
main Default
- Rust 83%
- Nix 17%
README.md
Bevy Term #
Easy terminal event handling and rendering with Bevy!

Description #
This crate primarily provides the TerminalPlugin for Bevy.
It allows for easily rendering to the terminal and handling terminal events.
Features #
- Write and order rendering systems for ratatui
- Integrate bevy entity data directly into your rendering
- Easily write observers for terminal events
Usage #
Check out the examples directory!
Add the TerminalPlugin
fn main() -> AppExit {
App::new()
.add_plugins(TerminalPlugin)
// ...
.run()
}
Register a system for rendering to the terminal
fn main() -> AppExit {
App::new()
.add_systems(PostUpdate, render)
// ...
.run()
}
fn render(mut frame: ResMut<Frame>) {
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([Constraint::Percentage(49), Constraint::Min(1)].as_ref())
.split(frame.area());
frame.render_widget(
Paragraph::new("Hellow World!\nPress `ESC` or `C-d` to exit.").alignment(Alignment::Center),
chunks[1],
);
}
(Optional) Register a system for handling terminal events
fn main() -> AppExit {
App::new()
.add_systems(Startup, handler_setup)
// ...
.run()
}
fn handler_setup(world: &mut World) {
world.add_observer(
|terminal_event: On<bevy_term::Event>, mut tui_state: ResMut<bevy_term::State>| {
if let Event::Key(key_event) = terminal_event.0
&& key_event.code == KeyCode::Esc
{
*tui_state = bevy_term::State::Exit
}
},
);
}