1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00

Add default_domain option

When set, changes the default domain to the domain with the specified
name, which potentially affects the default program.

eg: default_domain = "WSL:Ubuntu-18.04" will cause the initial tab
to be spawned via WSL.
This commit is contained in:
Wez Furlong 2022-01-08 14:57:39 -07:00
parent cdf3fc89f7
commit b2ee6793f9
2 changed files with 9 additions and 0 deletions

View File

@ -1266,6 +1266,9 @@ pub struct Config {
#[serde(default)]
pub allow_win32_input_mode: bool,
#[serde(default)]
pub default_domain: Option<String>,
}
impl_lua_conversion!(Config);

View File

@ -338,6 +338,12 @@ async fn update_mux_domains(config: &ConfigHandle, do_auto_connect: bool) -> any
mux.add_domain(&domain);
}
if let Some(name) = &config.default_domain {
if let Some(dom) = mux.get_domain_by_name(name) {
mux.set_default_domain(&dom);
}
}
Ok(())
}