From b19cc5b6c84a407acf29bd52afb50346edb16b97 Mon Sep 17 00:00:00 2001
From: zed-patches <zed-patches@localhost>
Date: Sun, 13 Sep 2026 14:01:21 -0300
Subject: [PATCH] cli: point the launcher at the Zeo application binary
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Two defects that only a running build could expose. `cargo check --workspace`
passes on both, and the compiler cannot reach either.

FIRST: the launcher could not find the application at all.

    $ ./cli --version
    Bundle detection: could not find any of:
        ../libexec/zed-editor, ../lib/zed/zed-editor, ./zed

The CLI locates the app by canonicalising a fixed list of paths relative to its
own `current_exe()`. Patch 0020 renamed the [[bin]] target to `zeo`, so `./zed`
stopped existing and the list went stale - silently, because the names are string
literals and nothing links them to the Cargo target they refer to.

The Zed entries are REMOVED rather than kept as a fallback, and that is the part
worth arguing. Keeping them looks harmless and is not: the lookup is relative to
the CLI's own directory, so on a machine with both editors installed
`/usr/bin/zeo` would resolve `../libexec/zed-editor` and quietly launch Zed. A
launcher that starts the wrong editor when its own is missing is worse than one
that fails with the message above - and coexistence is the entire point of the
separate binary name and the separate state directories.

Ordering matters for the same reason and is now moot: the list is Zeo-only, so
there is nothing for it to fall through to. The ebuild must therefore install the
application as `libexec/zeo-editor`, which is also what keeps it from colliding
with app-editors/zed's `libexec/zed-editor`.

SECOND: the launcher printed the wrong product name.

    Zed zeo  af76ae6e...  – .../target/release/zeo

"Zed" is a literal in three format strings - two in the Unix and Windows
`InstalledApp` implementations, one in the bundle path - and it is the product
name, not the channel. The channel beside it was already correct. Now:

    Zeo zeo  af76ae6e...  – .../target/release/zeo

The Windows array and format string are changed for symmetry with the
ReleaseChannel work, and are UNVERIFIED: nothing here builds for Windows.

Why this is a separate patch rather than a fix folded into 0020: the failure is
not in the binary's name, it is in everything that had been told the old one.
Keeping it apart records that the cost of renaming a binary is paid by its
consumers, and that the only thing that found them was running the program.
---
 crates/cli/src/main.rs | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs
index be97811..55e1b06 100644
--- a/crates/cli/src/main.rs
+++ b/crates/cli/src/main.rs
@@ -913,10 +913,10 @@ mod linux {
                 let cli = env::current_exe()?;
                 let dir = cli.parent().context("no parent path for cli")?;
 
-                // libexec is the standard, lib/zed is for Arch (and other non-libexec distros),
-                // ./zed is for the target directory in development builds.
+                // libexec is the standard, lib/zeo is for Arch (and other non-libexec distros),
+                // ./zeo is for the target directory in development builds.
                 let possible_locations =
-                    ["../libexec/zed-editor", "../lib/zed/zed-editor", "./zed"];
+                    ["../libexec/zeo-editor", "../lib/zeo/zeo-editor", "./zeo"];
                 possible_locations
                     .iter()
                     .find_map(|p| dir.join(p).canonicalize().ok().filter(|path| path != &cli))
@@ -932,7 +932,7 @@ mod linux {
     impl InstalledApp for App {
         fn zed_version_string(&self) -> String {
             format!(
-                "Zed {}{}{} – {}",
+                "Zeo {}{}{} – {}",
                 if *release_channel::RELEASE_CHANNEL_NAME == "stable" {
                     "".to_string()
                 } else {
@@ -1209,7 +1209,7 @@ mod windows {
     impl InstalledApp for App {
         fn zed_version_string(&self) -> String {
             format!(
-                "Zed {}{}{} – {}",
+                "Zeo {}{}{} – {}",
                 if *release_channel::RELEASE_CHANNEL_NAME == "stable" {
                     "".to_string()
                 } else {
@@ -1283,7 +1283,7 @@ mod windows {
 
                 // ../Zed.exe is the standard, lib/zed is for MSYS2, ./zed.exe is for the target
                 // directory in development builds.
-                let possible_locations = ["../Zed.exe", "../lib/zed/zed-editor.exe", "./zed.exe"];
+                let possible_locations = ["../Zeo.exe", "../lib/zeo/zeo-editor.exe", "./zeo.exe"];
                 possible_locations
                     .iter()
                     .find_map(|p| dir.join(p).canonicalize().ok().filter(|path| path != &cli))
@@ -1382,7 +1382,7 @@ mod mac_os {
 
     impl InstalledApp for Bundle {
         fn zed_version_string(&self) -> String {
-            format!("Zed {} – {}", self.version(), self.path().display(),)
+            format!("Zeo {} – {}", self.version(), self.path().display(),)
         }
 
         fn launch(&self, url: String, user_data_dir: Option<&str>) -> anyhow::Result<()> {
-- 
2.55.0

