git.lucas.co / cce-cloud
cloud storage client
git clone https://git.lucas.co/cce-cloud.git

commit5877564c5ae34783548c4477214e9d40fbfc6d8a
parent599e751be9
authorLucas Galante <[email protected]>
date2026-08-20 15:43
terminal_emulator: honor config.kdl default_terminal

Resolution is now $TERMINAL (user env override) → the DE's configured
default (config.kdl `default_terminal`, written by the settings app's
new Default Apps Terminal row; read through the mtime-cached config so
picks apply without a daemon restart) → foot. The positional hosting
convention is unchanged — cce-terminal accepts it as of its entry.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/main.rs | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index bf09d1b..cb643f2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -488,12 +488,19 @@ fn spawn_app(app: &AppInfo) {
 }
 
 /// Terminal used to host `Terminal=true` desktop entries: $TERMINAL if it
-/// resolves on PATH, else foot. Callers pass the command positionally
-/// (`term sh -c …`), not via `-e`, which foot does not accept.
+/// resolves on PATH (user env override), else the DE's configured default
+/// (config.kdl `default_terminal`, written by the settings app's Default
+/// Apps page), else foot. Callers pass the command positionally
+/// (`term sh -c …`), not via `-e` — the convention every candidate must
+/// accept (foot does natively; cce-terminal grew it alongside its entry).
 fn terminal_emulator() -> Option<String> {
     std::env::var("TERMINAL")
         .ok()
         .filter(|t| !t.is_empty() && command_in_path(t))
+        .or_else(|| {
+            cce_ui::config::get_string("/default_terminal")
+                .filter(|t| !t.is_empty() && command_in_path(t))
+        })
         .or_else(|| command_in_path("foot").then(|| "foot".to_string()))
 }