{"record":{"id":"c139a85c1f64376c","repo":"LGUG2Z/komorebi","slug":"env-komorebi-config-home-is-set-to-home-path","errorCode":null,"errorMessage":"$Env:KOMOREBI_CONFIG_HOME is set to '{home_path}', which is not a valid directory","messagePattern":"\\$Env:KOMOREBI_CONFIG_HOME is set to '(.+?)', which is not a valid directory","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"komorebic/src/main.rs","lineNumber":77,"sourceCode":"use komorebi_client::Sizing;\nuse komorebi_client::SocketMessage;\nuse komorebi_client::StateQuery;\nuse komorebi_client::StaticConfig;\nuse komorebi_client::WindowKind;\nuse komorebi_client::splash::ValidationFeedback;\n\nlazy_static! {\n    static ref HAS_CUSTOM_CONFIG_HOME: AtomicBool = AtomicBool::new(false);\n    static ref HOME_DIR: PathBuf = {\n        std::env::var(\"KOMOREBI_CONFIG_HOME\").map_or_else(\n            |_| dirs::home_dir().expect(\"there is no home directory\"),\n            |home_path| {\n                let home = home_path.replace_env();\n                if home.as_path().is_dir() {\n                    HAS_CUSTOM_CONFIG_HOME.store(true, Ordering::SeqCst);\n                    home\n                } else {\n                    panic!(\n                        \"$Env:KOMOREBI_CONFIG_HOME is set to '{home_path}', which is not a valid directory\",\n                    );\n                }\n            },\n        )\n    };\n    static ref DATA_DIR: PathBuf = dirs::data_local_dir()\n        .expect(\"there is no local data directory\")\n        .join(\"komorebi\");\n    static ref WHKD_CONFIG_DIR: PathBuf = {\n        std::env::var(\"WHKD_CONFIG_HOME\").map_or_else(\n            |_| {\n                dirs::home_dir()\n                    .expect(\"there is no home directory\")\n                    .join(\".config\")\n            },\n            |home_path| {\n                let whkd_config_home = home_path.replace_env();","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/LGUG2Z/komorebi/blob/e0709f02bfae4e503bf4640f58ee75ecbbfdbb97/komorebic/src/main.rs#L59-L95","documentation":"komorebic resolves its config directory from the KOMOREBI_CONFIG_HOME environment variable. If the variable is set but the path is not an existing directory, startup panics with this message. On success it also records that a custom config home is in use.","triggerScenarios":"Launching komorebic with KOMOREBI_CONFIG_HOME set to a non-existent path, a path pointing at a file, a typo'd path, or a drive that is not mounted.","commonSituations":"Stale env var after reorganizing the dotfiles; copying setup instructions with a different username in the path; pointing at the config file instead of its parent directory.","solutions":["Check the value: Test-Path $Env:KOMOREBI_CONFIG_HOME -PathType Container.","Correct the variable to the directory containing komorebi.json/bar.json, or remove it: Remove-Item Env:KOMOREBI_CONFIG_HOME.","Recreate the directory if it was deleted."],"exampleFix":"// before\n$Env:KOMOREBI_CONFIG_HOME = \"C:\\Users\\me\\.config\\komorebi\"\n// path missing\n// after\n$Env:KOMOREBI_CONFIG_HOME = \"$HOME\\.config\\komorebi\"\nNew-Item -ItemType Directory -Force $Env:KOMOREBI_CONFIG_HOME","handlingStrategy":"validation","validationCode":"if ($env:KOMOREBI_CONFIG_HOME -and -not (Test-Path $env:KOMOREBI_CONFIG_HOME -PathType Container)) { throw \"KOMOREBI_CONFIG_HOME is not a valid directory\" }","typeGuard":"fn valid_config_home(home_path: &str) -> bool {\n    std::path::Path::new(home_path).is_dir()\n}","tryCatchPattern":"std::panic::catch_unwind(|| komorebic::startup()).map_err(|_| anyhow!(\"verify KOMOREBI_CONFIG_HOME points to an existing directory\"))","preventionTips":["Use $HOME-based paths, not hard-coded usernames, when setting KOMOREBI_CONFIG_HOME","Remove-Item Env:KOMOREBI_CONFIG_HOME to fall back to defaults when unsure","Ensure the directory exists before komorebic start"],"tags":["environment-variable","config-home","path"],"backgroundTag":"path-is-not-a-directory","analyzedSha":"e0709f02bfae4e503bf4640f58ee75ecbbfdbb97","analyzedAt":"2026-09-06T07:08:05.107Z","contentChangedAt":"2026-09-06T07:08:05.107Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}