2021-10-20 22:53:25 +00:00
|
|
|
|
|
|
|
use moa::error::Error;
|
2021-12-07 03:52:04 +00:00
|
|
|
use moa::host::traits::{Host, Tty, WindowUpdater};
|
2021-10-20 22:53:25 +00:00
|
|
|
|
|
|
|
pub struct ConsoleFrontend;
|
|
|
|
|
2021-10-22 04:55:27 +00:00
|
|
|
impl Host for ConsoleFrontend {
|
2021-12-07 03:52:04 +00:00
|
|
|
fn create_pty(&self) -> Result<Box<dyn Tty>, Error> {
|
|
|
|
use moa_common::tty::SimplePty;
|
|
|
|
Ok(Box::new(SimplePty::open()?))
|
|
|
|
}
|
|
|
|
|
2021-11-13 18:54:19 +00:00
|
|
|
fn add_window(&mut self, updater: Box<dyn WindowUpdater>) -> Result<(), Error> {
|
2021-10-22 04:55:27 +00:00
|
|
|
println!("console: add_window() is not supported from the console; ignoring request...");
|
|
|
|
Ok(())
|
2021-10-20 22:53:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|