1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 11:17:15 +03:00

add default_workspace config option

refs: #1322
refs: #1531
This commit is contained in:
Wez Furlong 2022-01-17 09:31:20 -07:00
parent d169088694
commit 8d3d3e02a7
4 changed files with 24 additions and 3 deletions

View File

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

View File

@ -22,7 +22,7 @@ As features stabilize some brief notes about them will accumulate here.
* `Symbols Nerd Font Mono` is now bundled with WezTerm and is included as a default fallback font. This means that you may use any of the glyphs available in the [Nerd Fonts](https://github.com/ryanoasis/nerd-fonts) collection with any font without patching fonts and without explicitly adding that font to your fallback list. Pomicons have an unclear license for distribution and are excluded from this bundled font, however, you may manually install the font with those icons from the Nerd Font site itself and it will take precedence over the bundled font. This font replaces the older `PowerlineExtraSymbols` font. [#1521](https://github.com/wez/wezterm/issues/1521).
* [wezterm.nerdfonts](config/lua/wezterm/nerdfonts.md) as a convenient way to resolve Nerd Fonts glyphs by name in your config file
* [ShowLauncherArgs](config/lua/keyassignment/ShowLauncherArgs.md) key assignment to show the launcher scoped to certain items, or to launch it directly in fuzzy matching mode
* Workspaces. Follow work in progress on [#1531](https://github.com/wez/wezterm/issues/1531) and [#1322](https://github.com/wez/wezterm/discussions/1322)! [window:active_workspace()](config/lua/window/active_workspace.md)
* Workspaces. Follow work in progress on [#1531](https://github.com/wez/wezterm/issues/1531) and [#1322](https://github.com/wez/wezterm/discussions/1322)! [window:active_workspace()](config/lua/window/active_workspace.md) [default_workspace](config/lua/config/default_workspace.md)
#### Changed

View File

@ -0,0 +1,6 @@
# `default_workspace = "default"`
*Since: nightly builds only*
Specifies the name of the default workspace.
The default is `"default"`.

View File

@ -452,7 +452,12 @@ impl Publish {
command,
command_dir: None,
size: config.initial_size(),
workspace: workspace.unwrap_or(mux::DEFAULT_WORKSPACE).to_string(),
workspace: workspace.unwrap_or(
config
.default_workspace
.as_deref()
.unwrap_or(mux::DEFAULT_WORKSPACE)
).to_string(),
})
.await
}));
@ -525,7 +530,14 @@ fn setup_mux(
let client_id = Arc::new(mux::client::ClientId::new());
mux.register_client(client_id.clone());
mux.replace_identity(Some(client_id));
mux.set_active_workspace(default_workspace_name.unwrap_or(mux::DEFAULT_WORKSPACE));
mux.set_active_workspace(
default_workspace_name.unwrap_or(
config
.default_workspace
.as_deref()
.unwrap_or(mux::DEFAULT_WORKSPACE),
),
);
crate::update::load_last_release_info_and_set_banner();
update_mux_domains(config)?;