diff --git a/src/main.rs b/src/main.rs index ce16a56..d682bb5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -109,6 +109,21 @@ fn main() { #[cfg(target_os = "macos")] { + // incase of app bundle, we can just pass --disowned option straight away to bypass this check + #[cfg(not(debug_assertions))] + if !std::env::args().any(|f| f == "--disowned") { + if let Ok(curr_exe) = std::env::current_exe() { + assert!(std::process::Command::new(curr_exe) + .args(std::env::args().skip(1)) + .arg("--disowned") + .spawn() + .is_ok()); + std::process::exit(0); + } else { + eprintln!("error in disowning process, cannot obtain the path for the current executable, continuing without disowning..."); + } + } + use std::env; if env::var_os("TERM").is_none() { let mut profile_path = dirs::home_dir().unwrap(); diff --git a/src/renderer/caching_shaper.rs b/src/renderer/caching_shaper.rs index 4b8de98..2c3c65f 100644 --- a/src/renderer/caching_shaper.rs +++ b/src/renderer/caching_shaper.rs @@ -73,7 +73,10 @@ impl ExtendedFontFamily { let font = &handle.font; let properties = font.properties(); - if properties.weight == props.weight && properties.style == props.style { + if properties.weight == props.weight + && properties.style == props.style + && properties.stretch == props.stretch + { return Some(&font); } } diff --git a/src/settings/mod.rs b/src/settings/mod.rs index 06cdca3..9529584 100644 --- a/src/settings/mod.rs +++ b/src/settings/mod.rs @@ -68,8 +68,17 @@ impl Settings { if arg == "--log" { log_to_file = true; false + } else if arg == "--version" || arg == "-v" { + println!("Neovide version: {}", env!("CARGO_PKG_VERSION")); + std::process::exit(0); + } else if arg == "--help" || arg == "-h" { + println!("neovide: {}", env!("CARGO_PKG_DESCRIPTION")); + std::process::exit(0); } else { - !(arg.starts_with("--geometry=") || arg == "--wsl" || arg == "--multiGrid") + !(arg.starts_with("--geometry=") + || arg == "--wsl" + || arg == "--disowned" + || arg == "--multiGrid") } }) .collect::>();