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:
parent
9b4ddde908
commit
54047e357a
@ -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())));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user