From ced85ac11b0cc53059c74201b0ba22a8247d24e1 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 13 Jan 2020 10:44:17 -0800 Subject: [PATCH] macos: teach it about the color schemes path in the .app bundle --- src/config/mod.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 11f8dac6c95..b0d51067f6c 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -678,10 +678,18 @@ impl Config { } } - if cfg!(unix) { + if cfg!(target_os = "macos") { + if let Ok(exe_name) = std::env::current_exe() { + if let Some(colors_dir) = exe_name + .parent() + .map(|srcdir| srcdir.join("Contents").join("Resources").join("colors")) + { + paths.push(colors_dir); + } + } + } else if cfg!(unix) { paths.push(PathBuf::from("/usr/share/wezterm/colors")); - } - if cfg!(windows) { + } else if cfg!(windows) { // See commentary re: portable tools above! if let Ok(exe_name) = std::env::current_exe() { if let Some(exe_dir) = exe_name.parent() {