Files
ELYTerminal/src/main.rs
T
ZacharyZhang-NY ae1d8ce746
CI / platforms (windows-latest) (push) Failing after 8s
CI / macos (push) Failing after 8m31s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s
T06: terminal view: frame, colors and styles, wide and combining cells, cursor and blink, font, padding, resize; bundled faces and icon font; shot example
2026-10-14 12:59:32 -04:00

44 lines
1.2 KiB
Rust

use ely_gpui_component::Assets;
use elyterminal::{
app,
settings::SettingsStore,
term::shell::{ShellIntegration, launch},
};
use gpui::App;
/// A Linux app with no display server fails at start instead of running headless.
#[cfg(target_os = "linux")]
fn application() -> gpui::Application {
gpui_platform::linux(gpui::WindowingModes::WAYLAND | gpui::WindowingModes::X11)
}
#[cfg(not(target_os = "linux"))]
fn application() -> gpui::Application {
gpui_platform::application()
}
fn run(cx: &mut App) -> anyhow::Result<()> {
app::start(cx)?;
let home = dirs::home_dir().ok_or_else(|| anyhow::anyhow!("app: no home folder"))?;
let launch = launch(
&SettingsStore::get(cx).shell,
home,
&cx.global::<ShellIntegration>().0,
)?;
app::open(launch, cx)?;
cx.activate(true);
Ok(())
}
fn main() {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("elyterminal=info"))
.init();
application().with_assets(Assets).run(|cx: &mut App| {
ely_gpui_component::init(cx).expect("Ely failed to start");
if let Err(error) = run(cx) {
log::error!("{error:#}");
std::process::exit(1);
}
});
}