export WEZTERM_EXECUTABLE and WEZTERM_CONFIG_FILE to the env
This allows child processes to "do something" with that information. For example, portable wezterm deployments can use these paths to bootstrap some other portable config paths. refs: https://github.com/wez/wezterm/issues/152
This commit is contained in:
1 parent
bc6cf6eed6
commit
6f8af46def
2 files changed
+6
No files matched your search
@@ -593,6 +593,8 @@ impl Config {
|
||||
// Compute but discard the key bindings here so that we raise any
|
||||
// problems earlier than we use them.
|
||||
let _ = cfg.key_bindings()?;
|
||||
|
||||
std::env::set_var("WEZTERM_CONFIG_FILE", p);
|
||||
return Ok((cfg.compute_extra_defaults(Some(p)), Some(p.to_path_buf())));
|
||||
}
|
||||
|
||||
|
||||
@@ -689,6 +689,10 @@ fn maybe_show_configuration_error_window() {
|
||||
}
|
||||
|
||||
fn run() -> anyhow::Result<()> {
|
||||
if let Ok(exe) = std::env::current_exe() {
|
||||
std::env::set_var("WEZTERM_EXECUTABLE", exe);
|
||||
}
|
||||
|
||||
// This is a bit gross.
|
||||
// In order to not to automatically open a standard windows console when
|
||||
// we run, we use the windows_subsystem attribute at the top of this
|
||||
|
||||
Reference in new issue
Block a user