diff --git a/src/config.rs b/src/config.rs index 187e03d..805c9a3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -39,5 +39,13 @@ impl Config { } fn config_path() -> Option { + // Check XDG-style ~/.config first (takes precedence on all platforms), + // then fall back to the platform config dir (e.g. ~/Library/Preferences on macOS). + let xdg = dirs::home_dir().map(|h| h.join(".config").join("mdterm").join("config.toml")); + if let Some(ref p) = xdg { + if p.exists() { + return xdg; + } + } dirs::config_dir().map(|d| d.join("mdterm").join("config.toml")) }