This commit is contained in:
2026-09-07 23:01:44 +02:00
parent 9a9a94fc78
commit 6eb796494a
9 changed files with 56 additions and 42 deletions
+2 -2
View File
@@ -127,11 +127,11 @@ impl Default for Config {
impl Config {
pub fn path() -> Result<PathBuf> {
if let Some(dir) = std::env::var_os("XDG_CONFIG_HOME").filter(|p| !p.is_empty()) {
return Ok(PathBuf::from(dir).join("rust-term/config.toml"));
return Ok(PathBuf::from(dir).join("slerm/config.toml"));
}
Ok(
PathBuf::from(std::env::var_os("HOME").context("HOME is not set")?)
.join(".config/rust-term/config.toml"),
.join(".config/slerm/config.toml"),
)
}
+6 -6
View File
@@ -21,12 +21,12 @@ fn main() -> Result<()> {
"--check-config" => check = true,
"--init-config" => init = true,
"--version" => {
println!("rust-term {}", env!("CARGO_PKG_VERSION"));
println!("slerm {}", env!("CARGO_PKG_VERSION"));
return Ok(());
}
"--help" | "-h" => {
println!(
"rust-term [--config PATH] [--check-config | --init-config]\n\nDefault config: {}",
"slerm [--config PATH] [--check-config | --init-config]\n\nDefault config: {}",
path.display()
);
return Ok(());
@@ -69,17 +69,17 @@ fn main() -> Result<()> {
libghostty_vt::kitty::graphics::set_png_decoder(Some(Box::new(render::PngDecoder)))?;
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_title("rust-term")
.with_title("slerm")
.with_inner_size([config.window_width, config.window_height])
.with_min_inner_size([320.0, 200.0])
.with_app_id("rust-term"),
.with_app_id("slerm"),
renderer: eframe::Renderer::Wgpu,
..Default::default()
};
eframe::run_native(
"rust-term",
"slerm",
options,
Box::new(move |cc| Ok(Box::new(app::App::new(cc, config, path)?))),
)
.map_err(|e| anyhow::anyhow!("Cannot start rust-term: {e}"))
.map_err(|e| anyhow::anyhow!("Cannot start slerm: {e}"))
}
+1 -1
View File
@@ -37,7 +37,7 @@ pub fn terminal(config: &Config) -> Result<Terminal<'static, 'static>> {
})?;
term.resize(80, 24, 8, 16)?;
apply_config(&mut term, config)?;
term.on_xtversion(|_| Some("rust-term 0.1.0"))?;
term.on_xtversion(|_| Some(concat!("slerm ", env!("CARGO_PKG_VERSION"))))?;
term.on_device_attributes(|_| {
Some(terminal::DeviceAttributes {
primary: terminal::PrimaryDeviceAttributes::new(
+1 -1
View File
@@ -29,7 +29,7 @@ impl Pty {
cmd.args(&config.shell[1..]);
cmd.env("TERM", "xterm-256color");
cmd.env("COLORTERM", "truecolor");
cmd.env("TERM_PROGRAM", "rust-term");
cmd.env("TERM_PROGRAM", "slerm");
cmd.env("TERM_PROGRAM_VERSION", env!("CARGO_PKG_VERSION"));
if let Some(dir) = &config.working_directory {
cmd.cwd(dir);
+2 -2
View File
@@ -590,7 +590,7 @@ mod tests {
#[ignore = "manual CPU rendering benchmark"]
fn renderer_frame_cost() {
let config = crate::config::Config {
font_path: std::env::var_os("RUST_TERM_TEST_FONT").map(Into::into),
font_path: std::env::var_os("SLERM_TEST_FONT").map(Into::into),
..Default::default()
};
let ctx = egui::Context::default();
@@ -671,7 +671,7 @@ mod tests {
#[test]
fn terminal_cells_match_font_line_metrics() {
let config = crate::config::Config {
font_path: std::env::var_os("RUST_TERM_TEST_FONT").map(Into::into),
font_path: std::env::var_os("SLERM_TEST_FONT").map(Into::into),
..Default::default()
};
for scale in [1.0, 1.5, 2.0] {