Initial GPUI Wayland terminal with Alacritty core
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
mod colors;
|
||||
mod fonts;
|
||||
mod input;
|
||||
mod render;
|
||||
mod session;
|
||||
mod terminal;
|
||||
|
||||
use gpui::{prelude::*, *};
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
env_logger::init();
|
||||
let (session, events) = session::Session::new()?;
|
||||
Application::new().run(move |cx: &mut App| {
|
||||
cx.on_window_closed(|cx| {
|
||||
if cx.windows().is_empty() {
|
||||
cx.quit();
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
let bounds = Bounds::centered(None, size(px(960.), px(640.)), cx);
|
||||
cx.open_window(
|
||||
WindowOptions {
|
||||
window_bounds: Some(WindowBounds::Windowed(bounds)),
|
||||
titlebar: Some(TitlebarOptions {
|
||||
title: Some("Terminal".into()),
|
||||
..Default::default()
|
||||
}),
|
||||
app_id: Some("dev.buzzert.terminal".into()),
|
||||
..Default::default()
|
||||
},
|
||||
move |window, cx| cx.new(|cx| terminal::TerminalView::new(session, events, window, cx)),
|
||||
)
|
||||
.expect("could not open terminal window");
|
||||
cx.activate(true);
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user