diff --git a/Cargo.lock b/Cargo.lock index 3e0ab2d59..01570574d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4174,6 +4174,7 @@ dependencies = [ "async_ossl", "codec", "config", + "env-bootstrap", "filedescriptor", "futures", "hostname", diff --git a/env-bootstrap/src/lib.rs b/env-bootstrap/src/lib.rs index b9603c4de..5c4376bc5 100644 --- a/env-bootstrap/src/lib.rs +++ b/env-bootstrap/src/lib.rs @@ -107,3 +107,12 @@ pub fn set_lang_from_locale() { } } } + +pub fn bootstrap() { + set_wezterm_executable(); + + #[cfg(target_os = "macos")] + set_lang_from_locale(); + + fixup_appimage(); +} diff --git a/wezterm-gui/src/main.rs b/wezterm-gui/src/main.rs index 660a6eb1c..94372fe2c 100644 --- a/wezterm-gui/src/main.rs +++ b/wezterm-gui/src/main.rs @@ -404,12 +404,7 @@ fn run() -> anyhow::Result<()> { } }; - env_bootstrap::set_wezterm_executable(); - - #[cfg(target_os = "macos")] - env_bootstrap::set_lang_from_locale(); - - env_bootstrap::fixup_appimage(); + env_bootstrap::bootstrap(); pretty_env_logger::init_timed(); stats::Stats::init()?; diff --git a/wezterm-mux-server/Cargo.toml b/wezterm-mux-server/Cargo.toml index 646ddf111..2c3d44099 100644 --- a/wezterm-mux-server/Cargo.toml +++ b/wezterm-mux-server/Cargo.toml @@ -11,6 +11,7 @@ anyhow = "1.0" async_ossl = { path = "../async_ossl" } codec = { path = "../codec" } config = { path = "../config" } +env-bootstrap = { path = "../env-bootstrap" } filedescriptor = { version="0.7", path = "../filedescriptor" } futures = "0.3" hostname = "0.3" diff --git a/wezterm-mux-server/src/main.rs b/wezterm-mux-server/src/main.rs index 12a9d1eb0..f48d75b89 100644 --- a/wezterm-mux-server/src/main.rs +++ b/wezterm-mux-server/src/main.rs @@ -54,6 +54,8 @@ fn main() { } fn run() -> anyhow::Result<()> { + env_bootstrap::bootstrap(); + //stats::Stats::init()?; config::designate_this_as_the_main_thread(); let _saver = umask::UmaskSaver::new(); diff --git a/wezterm/src/main.rs b/wezterm/src/main.rs index 61304c089..aa3c49a75 100644 --- a/wezterm/src/main.rs +++ b/wezterm/src/main.rs @@ -179,12 +179,7 @@ fn main() { } fn run() -> anyhow::Result<()> { - env_bootstrap::set_wezterm_executable(); - - #[cfg(target_os = "macos")] - env_bootstrap::set_lang_from_locale(); - - env_bootstrap::fixup_appimage(); + env_bootstrap::bootstrap(); pretty_env_logger::init_timed(); let _saver = umask::UmaskSaver::new();