From a025fd6380cbd907e7abf999ffde6003e9e00436 Mon Sep 17 00:00:00 2001 From: leyoda Date: Thu, 23 Apr 2026 19:17:26 +0200 Subject: [PATCH] yoda: prefer cosmic-yoterm over upstream cosmic-term in terminal fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mime_app::MimeAppCache::terminal() hardcoded "com.system76.CosmicTerm" as the only non-xdg-default fallback. On a yoda stack the relevant terminal is our fork cosmic-yoterm (desktop id com.aditua.CosmicYoterm), so we add it first in preference_order. xdg-mime default still wins when set — this just covers the case where it isn't. Fixes "Open in terminal" launching Konsole (or first random terminal in apps list) instead of cosmic-yoterm when xdg-mime default is unset or points to something else. --- src/mime_app.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mime_app.rs b/src/mime_app.rs index 4a55cdf..b8985ce 100644 --- a/src/mime_app.rs +++ b/src/mime_app.rs @@ -399,9 +399,12 @@ impl MimeAppCache { // The current approach works but might not adhere to the spec (yet) // Look for and return preferred terminals - //TODO: fallback order beyond cosmic-term? - - let mut preference_order = vec!["com.system76.CosmicTerm".to_string()]; + // Yoda: cosmic-yoterm (our fork) wins over upstream cosmic-term if both + // are installed — useful when xdg-mime default is not set. + let mut preference_order = vec![ + "com.aditua.CosmicYoterm".to_string(), + "com.system76.CosmicTerm".to_string(), + ]; if let Some(id) = self.get_default_terminal() { preference_order.insert(0, id);