1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-01 00:35:46 +03:00

export WEZTERM_CONFIG_DIR and WEZTERM_EXECUTABLE_DIR

To make things more convenient on Windows, export the directories
as well as the file names that we discovered.

refs: https://github.com/wez/wezterm/issues/152
This commit is contained in:
Wez Furlong 2020-02-24 08:03:59 -08:00
parent 9b4ddde908
commit 54047e357a
2 changed files with 6 additions and 0 deletions

View File

@ -595,6 +595,9 @@ impl Config {
let _ = cfg.key_bindings()?;
std::env::set_var("WEZTERM_CONFIG_FILE", p);
if let Some(dir) = p.parent() {
std::env::set_var("WEZTERM_CONFIG_DIR", dir);
}
return Ok((cfg.compute_extra_defaults(Some(p)), Some(p.to_path_buf())));
}

View File

@ -701,6 +701,9 @@ fn maybe_show_configuration_error_window() {
fn run() -> anyhow::Result<()> {
if let Ok(exe) = std::env::current_exe() {
if let Some(dir) = exe.parent() {
std::env::set_var("WEZTERM_EXECUTABLE_DIR", dir);
}
std::env::set_var("WEZTERM_EXECUTABLE", exe);
}