{"record":{"id":"71a823d93ce712fc","repo":"helix-editor/helix","slug":"current-working-directory-does-not-exist","errorCode":null,"errorMessage":"Current working directory does not exist","messagePattern":"Current working directory does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helix-term/src/commands.rs","lineNumber":2616,"sourceCode":"        PickerColumn::new(\"path\", |item: &FileResult, config: &GlobalSearchConfig| {\n            config\n                .style\n                .stylize(Some(&item.path), Some(item.line_start))\n        }),\n        PickerColumn::hidden(\"contents\"),\n    ];\n\n    let get_files = |query: &str,\n                     editor: &mut Editor,\n                     config: std::sync::Arc<GlobalSearchConfig>,\n                     injector: &ui::picker::Injector<_, _>| {\n        if query.is_empty() {\n            return async { Ok(()) }.boxed();\n        }\n\n        let search_root = helix_stdx::env::current_working_dir();\n        if !search_root.exists() {\n            return async { Err(anyhow::anyhow!(\"Current working directory does not exist\")) }\n                .boxed();\n        }\n\n        let documents: Vec<_> = editor\n            .documents()\n            .map(|doc| (doc.path().map(ToOwned::to_owned), doc.text().to_owned()))\n            .collect();\n\n        let matcher = match RegexMatcherBuilder::new()\n            .case_smart(config.smart_case)\n            .multi_line(true)\n            .build(query)\n        {\n            Ok(matcher) => {\n                // Clear any \"Failed to compile regex\" errors out of the statusline.\n                editor.clear_status();\n                matcher\n            }","sourceCodeStart":2598,"sourceCodeEnd":2634,"githubUrl":"https://github.com/helix-editor/helix/blob/079a789e8cb08ead67f19e1971a1b7438b37354b/helix-term/src/commands.rs#L2598-L2634","documentation":"Before :global-search streams results, commands.rs resolves the search root from helix_stdx::env::current_working_dir() — helix's cached CWD (captured at startup or the last :cd, kept because std::env::current_dir() fails once the dir is gone) — and checks .exists(). If that directory was deleted, renamed, or unmounted while helix runs, the picker aborts with this error instead of searching.","triggerScenarios":"Start hx inside a directory, remove it from another terminal (rm -rf, git worktree remove, deleted release dir), then invoke :global-search with any query.","commonSituations":"Editing in /tmp or scratch dirs that cleaners remove; git worktrees deleted from another session; container/pod volumes unmounted or replaced during a deploy while an editor stayed open.","solutions":["Run `:cd <existing-dir>` (updates the cached CWD) and retry :global-search.","If the project moved or the old path is gone for good, exit and restart helix from a valid directory.","If the path should exist, recreate it (mkdir -p) and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let root = helix_stdx::env::current_working_dir();\nif !root.exists() {\n    // prompt `:cd <valid-dir>` instead of running :global-search\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not keep long-lived sessions in temp dirs or git worktrees other tools may delete.","After `git worktree remove` or container rebuilds, `:cd` to a live path before workspace-wide commands."],"tags":["filesystem","cwd","global-search"],"backgroundTag":null,"analyzedSha":"079a789e8cb08ead67f19e1971a1b7438b37354b","analyzedAt":"2026-08-16T09:09:59.668Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}