helix-editor/helix · error
Current working directory does not exist
Error message
Current working directory does not exist
What it means
The syntax-based workspace symbol picker (syntax_workspace_symbol_picker in commands/syntax.rs, the workspace-wide variant under the pickers menu) searches open documents first, then uses helix_stdx::env::current_working_dir() — helix's cached CWD — as the root for workspace-wide scanning. Like :global-search it checks root.exists() and errors immediately if the directory was deleted, renamed, or unmounted while helix runs.
Source
Thrown at helix-term/src/commands/syntax.rs:330
Ok(pattern) => pattern,
Err(err) => return async { Err(anyhow::anyhow!(err)) }.boxed(),
};
let loader = editor.syn_loader.load();
for doc in editor.documents() {
let Some(syntax) = doc.syntax() else { continue };
let text = doc.text().slice(..);
let uri_or_id = doc
.uri()
.map(UriOrDocumentId::Uri)
.unwrap_or_else(|| UriOrDocumentId::Id(doc.id()));
for tag in tags_iter(syntax, &loader, text.slice(..), uri_or_id, Some(&pattern)) {
if injector.push(tag).is_err() {
return async { Ok(()) }.boxed();
}
}
}
if !state.search_root.exists() {
return async { Err(anyhow::anyhow!("Current working directory does not exist")) }
.boxed();
}
let matcher = match state.regex_matcher_builder.build(query) {
Ok(matcher) => {
// Clear any "Failed to compile regex" errors out of the statusline.
editor.clear_status();
matcher
}
Err(err) => {
log::info!(
"Failed to compile search pattern in workspace symbol search: {}",
err
);
return async { Err(anyhow::anyhow!("Failed to compile regex")) }.boxed();
}
};
let pattern = Arc::new(pattern);
let injector = injector.clone();View on GitHub (pinned to 079a789e8c)
Solutions
- Run `:cd <existing-dir>` to update the cached working directory, then reopen the picker.
- Restart helix from a directory that still exists.
- Recreate the missing directory (mkdir -p) if the path is supposed to exist.
Defensive patterns
Strategy: validation
Validate before calling
let root = helix_stdx::env::current_working_dir();
if !root.exists() {
// `:cd` somewhere valid before opening the workspace symbol picker
} Prevention
- Avoid sessions rooted in directories other processes may delete (worktrees, /tmp).
- After external deletions, run `:cd` to refresh helix's cached CWD before workspace scans.
When it happens
Trigger: Open the workspace symbol picker after the directory helix started in (or last :cd'ed to) was removed by another terminal, a tmp cleaner, or a container volume unmount.
Common situations: Deleted git worktrees; /tmp and scratch dirs cleaned mid-session; deploy pipelines removing old release directories under a long-running editor.
Related errors
- Current working directory does not exist
- Could not change working directory to '{}': {err}
- expected a path to file, but found a directory: {file:?}. (t
- --working-dir specified does not exist or is not a directory
- Failed to compile regex
AI-assisted analysis of helix-editor/helix@079a789e8c (2026-08-16).
Data as JSON: /api/errors/4a93f7b0f3b284da.
Report an issue: GitHub.