mirror of
https://github.com/wez/wezterm.git
synced 2024-09-20 11:17:15 +03:00
launcher: remove WSL items from list
These are now redundant with the list of wsl_domains. The `add_wsl_distributions_to_launch_menu` option has been removed.
This commit is contained in:
parent
0e9924e585
commit
cdf3fc89f7
@ -1180,9 +1180,6 @@ pub struct Config {
|
||||
#[serde(default = "default_true")]
|
||||
pub automatically_reload_config: bool,
|
||||
|
||||
#[serde(default = "default_true")]
|
||||
pub add_wsl_distributions_to_launch_menu: bool,
|
||||
|
||||
#[serde(default = "default_true")]
|
||||
pub check_for_updates: bool,
|
||||
#[serde(default)]
|
||||
|
@ -7,9 +7,9 @@
|
||||
//! menus.
|
||||
use crate::termwindow::TermWindowNotif;
|
||||
use anyhow::anyhow;
|
||||
use config::configuration;
|
||||
use config::keyassignment::{InputMap, KeyAssignment, SpawnCommand, SpawnTabDomain};
|
||||
use config::lua::truncate_right;
|
||||
use config::{configuration, WslDistro};
|
||||
use fuzzy_matcher::skim::SkimMatcherV2;
|
||||
use fuzzy_matcher::FuzzyMatcher;
|
||||
use mux::domain::{DomainId, DomainState};
|
||||
@ -28,7 +28,6 @@ use window::WindowOps;
|
||||
bitflags::bitflags! {
|
||||
pub struct LauncherFlags :u32 {
|
||||
const ZERO = 0;
|
||||
const WSL_DISTROS = 1;
|
||||
const TABS = 2;
|
||||
const LAUNCH_MENU_ITEMS = 4;
|
||||
const DOMAINS = 8;
|
||||
@ -48,27 +47,6 @@ struct Entry {
|
||||
pub kind: EntryKind,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn enumerate_wsl_entries(entries: &mut Vec<Entry>) -> anyhow::Result<()> {
|
||||
let distros = WslDistro::load_distro_list()?;
|
||||
for distro in distros {
|
||||
let label = format!("{} (WSL)", distro.name);
|
||||
entries.push(Entry {
|
||||
label: label.clone(),
|
||||
kind: EntryKind::KeyAssignment(KeyAssignment::SpawnCommandInNewTab(SpawnCommand {
|
||||
args: Some(vec![
|
||||
"wsl.exe".to_owned(),
|
||||
"--distribution".to_owned(),
|
||||
distro.name,
|
||||
]),
|
||||
..Default::default()
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub struct LauncherTabEntry {
|
||||
pub title: String,
|
||||
pub tab_id: TabId,
|
||||
@ -247,11 +225,6 @@ impl LauncherState {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
if args.flags.contains(LauncherFlags::WSL_DISTROS) {
|
||||
let _ = enumerate_wsl_entries(&mut self.entries);
|
||||
}
|
||||
|
||||
for domain in &args.domains {
|
||||
let entry = if domain.state == DomainState::Attached {
|
||||
Entry {
|
||||
|
@ -1669,11 +1669,7 @@ impl TermWindow {
|
||||
fn show_launcher(&mut self) {
|
||||
self.show_launcher_impl(
|
||||
"Launcher",
|
||||
if self.config.add_wsl_distributions_to_launch_menu {
|
||||
LauncherFlags::WSL_DISTROS
|
||||
} else {
|
||||
LauncherFlags::ZERO
|
||||
} | LauncherFlags::LAUNCH_MENU_ITEMS
|
||||
LauncherFlags::LAUNCH_MENU_ITEMS
|
||||
| LauncherFlags::DOMAINS
|
||||
| LauncherFlags::KEY_ASSIGNMENTS,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user