{"record":{"id":"86638863c198f45d","repo":"zed-industries/zed","slug":"failed-to-determine-xdg-config-home-directory","errorCode":null,"errorMessage":"failed to determine XDG_CONFIG_HOME directory","messagePattern":"failed to determine XDG_CONFIG_HOME directory","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/paths/src/paths.rs","lineNumber":134,"sourceCode":"        // don't choke on the verbatim syntax.\n        SanitizedPath::new(&canonicalized).as_path().to_path_buf()\n    })\n}\n\n/// Returns the path to the configuration directory used by Zed.\npub fn config_dir() -> &'static PathBuf {\n    CONFIG_DIR.get_or_init(|| {\n        if let Some(custom_dir) = CUSTOM_DATA_DIR.get() {\n            custom_dir.join(\"config\")\n        } else if cfg!(target_os = \"windows\") {\n            dirs::config_dir()\n                .expect(\"failed to determine RoamingAppData directory\")\n                .join(APP_NAME)\n        } else if cfg!(any(target_os = \"linux\", target_os = \"freebsd\")) {\n            if let Ok(flatpak_xdg_config) = std::env::var(\"FLATPAK_XDG_CONFIG_HOME\") {\n                flatpak_xdg_config.into()\n            } else {\n                dirs::config_dir().expect(\"failed to determine XDG_CONFIG_HOME directory\")\n            }\n            .join(APP_NAME_LOWERCASE)\n        } else {\n            home_dir().join(\".config\").join(APP_NAME_LOWERCASE)\n        }\n    })\n}\n\n/// Returns the path to the data directory used by Zed.\npub fn data_dir() -> &'static PathBuf {\n    CURRENT_DATA_DIR.get_or_init(|| {\n        if let Some(custom_dir) = CUSTOM_DATA_DIR.get() {\n            custom_dir.clone()\n        } else if cfg!(target_os = \"macos\") {\n            home_dir()\n                .join(\"Library/Application Support\")\n                .join(APP_NAME)\n        } else if cfg!(any(target_os = \"linux\", target_os = \"freebsd\")) {","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/paths/src/paths.rs#L116-L152","documentation":"Panic on Linux/BSD when the computed XDG_CONFIG_HOME cannot be determined: the dirs-style lookup found neither a usable XDG_CONFIG_HOME env var nor a home directory (HOME unset and no passwd entry). This leaves no base path for ~/.config/zed, so config_dir construction aborts.","triggerScenarios":"Thrown at crates/paths/src/paths.rs:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set HOME or XDG_CONFIG_HOME to an absolute path in the environment","If XDG_CONFIG_HOME is set, ensure it is absolute (relative values are invalid per the spec and are ignored)","Propagate an error instead of panicking so callers can show guidance"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}