{"record":{"id":"bbdf94d8885400f7","repo":"nikivdev/code","slug":"app-exited-with-status-status-bbdf94","errorCode":null,"errorMessage":"{app} exited with status {status}","messagePattern":"(.+?) exited with status (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/repos.rs","lineNumber":107,"sourceCode":"        .status()\n        .context(\"failed to run git clone\")?;\n\n    if !status.success() {\n        bail!(\"git clone failed\");\n    }\n\n    Ok(())\n}\n\nfn open_in_zed(path: &std::path::Path) -> Result<()> {\n    let try_open = |app: &str| -> Result<()> {\n        let status = std::process::Command::new(\"open\")\n            .args([\"-a\", app])\n            .arg(path)\n            .status()\n            .with_context(|| format!(\"failed to open {app}\"))?;\n        if !status.success() {\n            bail!(\"{app} exited with status {status}\");\n        }\n        Ok(())\n    };\n\n    try_open(\"/Applications/Zed.app\").or_else(|_| try_open(\"/Applications/Zed Preview.app\"))\n}\n\n/// Fuzzy search through repos in ~/repos and print the selected path.\nfn fuzzy_select_repo() -> Result<()> {\n    let root = config::expand_path(DEFAULT_REPOS_ROOT);\n    if !root.exists() {\n        println!(\"No repos directory found at {}\", root.display());\n        println!(\"Clone a repo with: f repos clone <url>\");\n        return Ok(());\n    }\n\n    let repos = discover_repos(&root)?;\n    if repos.is_empty() {","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/repos.rs#L89-L125","documentation":"open_in_zed tries to open a path with macOS `open -a Zed.app` (falling back to Zed Preview.app). If an `open` invocation succeeds in launching but the app exits non-zero, the tool bails with the app name and exit status. It indicates Zed launched but terminated abnormally.","triggerScenarios":"`open -a /Applications/Zed.app <path>` returns a non-zero exit status during `f` repo-open operations (run / fuzzy_select_repo flows).","commonSituations":"Zed crashing on startup; corrupted Zed install or pending broken update; macOS `open` reporting failure for an unresponsive app; unsupported/binary file causing Zed to abort.","solutions":["Launch Zed manually on the path to see the actual failure","Reinstall or update Zed (check /Applications/Zed.app integrity)","Open the path with an alternate editor if Zed keeps crashing","Retry with Zed Preview vs stable — one of the two fallbacks may work"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const fs = require(\"fs\");\nconst zedPaths = [\"/Applications/Zed.app\", \"/Applications/Zed Preview.app\"];\nif (!zedPaths.some((p) => fs.existsSync(p))) console.warn(\"Zed not installed; pick another editor\");","typeGuard":null,"tryCatchPattern":"try {\n  run([\"f\", \"repo-open\", path]);\n} catch (e) {\n  if (String(e).includes(\"exited with status\")) {\n    execSync(`code ${path}`); // fallback to another editor\n  } else throw e;\n}","preventionTips":["Keep Zed updated and verify it launches normally at least once after install/update","Set a preferred editor in tool config when supported instead of relying on app detection","Handle both Zed stable and Zed Preview presence in scripts"],"tags":["macos","editor","zed","process-exit"],"backgroundTag":"editor-launch-failed","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}