zed: Hide Install CLI menu button on Windows (#37843)

The "Install CLI" menu button and `install_cli::Install` action are
effectively no-op on Windows since the CLI is directly available in
Windows Terminal (CMD prompt, PowerShell, etc.) after the user runs Zed
installer package.

Release Notes:

- N/A

Co-authored-by: Peter Tripp <peter@zed.dev>
This commit is contained in:
Jakub Konka
2025-09-09 20:56:08 +02:00
committed by GitHub
co-authored by Peter Tripp
parent 707d0e6ebd
commit d8085d3ac0
5 changed files with 130 additions and 115 deletions
+6 -3
View File
@@ -806,7 +806,6 @@ fn register_actions(
}
}
})
.register_action(install_cli)
.register_action(|_, _: &install_cli::RegisterZedScheme, window, cx| {
cx.spawn_in(window, async move |workspace, cx| {
install_cli::register_zed_scheme(cx).await?;
@@ -915,6 +914,9 @@ fn register_actions(
capture_audio(workspace, window, cx);
});
#[cfg(not(target_os = "windows"))]
workspace.register_action(install_cli);
if workspace.project().read(cx).is_via_remote_server() {
workspace.register_action({
move |workspace, _: &OpenServerSettings, window, cx| {
@@ -1030,13 +1032,14 @@ fn about(
.detach();
}
#[cfg(not(target_os = "windows"))]
fn install_cli(
_: &mut Workspace,
_: &install_cli::Install,
_: &install_cli::InstallCliBinary,
window: &mut Window,
cx: &mut Context<Workspace>,
) {
install_cli::install_cli(window, cx);
install_cli::install_cli_binary(window, cx)
}
static WAITING_QUIT_CONFIRMATION: AtomicBool = AtomicBool::new(false);
+2 -1
View File
@@ -39,7 +39,8 @@ pub fn app_menus() -> Vec<Menu> {
MenuItem::os_submenu("Services", gpui::SystemMenuType::Services),
MenuItem::separator(),
MenuItem::action("Extensions", zed_actions::Extensions::default()),
MenuItem::action("Install CLI", install_cli::Install),
#[cfg(not(target_os = "windows"))]
MenuItem::action("Install CLI", install_cli::InstallCliBinary),
MenuItem::separator(),
#[cfg(target_os = "macos")]
MenuItem::action("Hide Zed", super::Hide),